X635: lastNodeRef1

Consider the following class definition:
   class Link{
      Object data;
      Link next;
   }
List L has a reference p to the first node. Write code that traverses L and returns a reference to the last node. Make sure to account for edge cases!

Initial Setup Final Configuration

Your Answer:

Reset
Visualize

Feedback

Your feedback will appear here when you check your answer.