Assignment 2: Recursive Indexing Solution