Suppose thatxandyare references to nodes of circularly linked lists,
although not necessarily the same list. Describe a fast algorithm for telling
ifxandybelong to the same list.
Our CircularQueue class of Section 7.2.2 provides a rotate( ) method that
has semantics equivalent to Q.enqueue(Q.dequeue( )), for a nonempty
queue. Implement such a method for the LinkedQueue class of Section
7.1.2 without the creation of any new nodes.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here