X400: circularList1

Consider the following class definition:

  public static class Link {
    public Link next;
    public Object data;
  }

Write a single assigment statement to transform the linked list headed by p into a circular linked list. It is given that the list L contains the elements [1,2,3] and p points to 1 and r points to 3. Your statement must refer to p and r.

Here is the initial set up:

and here is the expected final configuration

Your Answer:

Reset
Visualize

Feedback

Your feedback will appear here when you check your answer.