package lab04; public class TestADT { public static void main(String[] args) { QueueNode queue = new QueueNode(); queue.enqueue( 100 ); queue.enqueue( 200 ); queue.enqueue( 250 ); queue.enqueue( 350 ); queue.print( ); queue.dequeue( ); queue.dequeue( ); queue.print( ); LinkedListNode list = new LinkedListNode(); list.addRandomList(); System.out.println(); list.print( ); list.makeListLoopy(); checkListLoopy( list ); } static void checkListLoopy( LinkedListNode list ) { // Check if list is cyclic or not // Print the result; if the list is cyclic, print the cycle length // Use two pointers fast and slow that walk along the list at different // speeds LinkedListNode fast = list.next; LinkedListNode slow = list; } }