Reading material

Pages 163-165 (Section 4.3.2 and 4.3.3)

Review pages 159-163 (Section 4.3.1)

Additional material

Implementation of a stack and queue with a singly linked list in pseudocode: PostScript and PDF

LinkedStack
Node
LinkedQueue

Question

Write a method that reverses a linked list.
/**
   Reverses a linked list.

   @param node First node of the linked list to be reversed.
   @return First node of the reversed list.
*/
public static Node reverse(Node node)