Lab 5
Cycle Detection
Preliminaries:

Download the Sequence class and the driver

Objective

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.

Hints

You may use the following (nonstatic) methods from the Sequence class

Example Dialog
A program that can detect cycles efficiently will give the following output

        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
    
Finally:

Upload the .java file to the dropbox