Data Structures Efficiency Homework