Chapter 1 Problem 9 -- Sahini Datastructures book