Advanced Data Structures homework