Practice Overview

These problems use the ideas and techniques from the chapter on problems you have not seen before. Try them after you have read the chapter and feel confident with the material. For each problem, write your own solution before you read 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: Round-Robin Scheduling
  2. Solution: A Queue of Burst Times
  3. Solution: A Queue of Task Indices
  4. Solution: Cost of the Simulation
  5. Problem: Josephus
  6. Solution: Marking the Eliminated
  7. Solution: Rotating a Queue
  8. Solution: The Circularly Linked List
  9. Solution: Counting Around a Circular List
  10. Problem: Moving Average
  11. Solution: Keeping a Running Sum
  12. Problem: Queue with Two Stacks
  13. Solution: Pouring Only When Empty