Practice Overview

These problems take the ideas and techniques you learned in the chapter and apply them to new contexts. It is best to attempt these after reading the chapter and feeling confident with the material. For each problem, write your own solution before reading the provided one. Give yourself more time to work through each problem.

You can download the accompanying code for these practice problems: starter and solution.

  1. Problem: Reverse a Linked List
  2. Solution: Building a New List
  3. Solution: Re-Pointing the Links
  4. Problem: Detect a Cycle in a Linked List
  5. Solution: Re-Searching Seen Items
  6. Solution: Slow and Fast Pointers
  7. Problem: Kth to Last Element in Linked List
  8. Solution: A Fixed Gap Between Two Pointers