X395: changeHeadPointer2

Consider the following class definition:
   class Link{
      Object data;
      Link next;
   }
Write the required statements to make the variable p refer to the Node with info '2' using the node q. Given that the list L contains the elements [1,2,3] and p points to 1 and q points to 2.You must use both variables p and q.

Initial Setup Final Configuration

Your Answer:

Reset
Visualize

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.