Download the Sequence class and the driver
Write a class called CycleDetector which will be used to efficiently detect a cycle in the sequence generated by Sequence
Your class must do the following:
Your method must work with only a constant amount of extra space.
You may use the following (nonstatic) methods from the Sequence class
1) Cycle identified correctly.
2) Cycle identified correctly.
3) Cycle identified correctly.
4) Cycle identified correctly.
5) Cycle identified correctly.
6) Cycle identified correctly.
7) Cycle identified correctly.
8) Cycle identified correctly.
9) Cycle identified correctly.
10) Cycle identified correctly.
If you detect a cycle but use too much space, you should see the folloiwing error:
ERROR: Memory usage exceeded
Upload the .java file to the dropbox