X406: findValueInList

Consider the following class definition:
   class Link{
      Object data;
      Link next;
   }
Write a while loop to make q refer successively to each node in the linked list headed by p until q refers to the first Node with info (lowercase) 'c'. Given that the list L contains the elements [a,b,c,c] and p and q both point to 'a'.

Initial Setup Final Configuration

Your Answer:

Reset
Visualize

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.