Data structure final homework