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.
- Problem: Round-Robin Scheduling
- Solution: A Queue of Burst Times
- Solution: A Queue of Task Indices
- Solution: Cost of the Simulation
- Problem: Josephus
- Solution: Marking the Eliminated
- Solution: Rotating a Queue
- Solution: The Circularly Linked List
- Solution: Counting Around a Circular List
- Problem: Moving Average
- Solution: Keeping a Running Sum
- Problem: Queue with Two Stacks
- Solution: Pouring Only When Empty