Sale!

  Homework 9: Trees

$25.00

Category:

Description

5/5 - (2 votes)

CS1372  Homework 9: Trees
This Assignment is due via T-Square Sunday, July 26 at 5:00pm
T-Square will only accept submissions until 10pm. This way, you can’t try to
blame me if you’re up until 6am before a Monday final.
Purpose
This assignment is to learn about linked lists. Once you finish this, you’re done with 1372 homeworks!
(Assuming you don’t retake the class. Actual reults may vary.)
Instructions
For this assignment, you may use any video mode you deem suitable. However, the graphics must run
smoothly. You should create a system to keep track of items in an inventory on the GBA. You should have
a home screen where the user has the option of adding an item to the inventory or viewing the inventory. If
the user chooses to add an item, your program should use the text entry system you made in homework 7 to
get a string containing the name of the item being added. The entire inventory must be stored in a binary
tree and all items should be inserted in order.
1. A library for a binary tree.
2. A function to add an element to the tree in order.
3. A function to traverse the tree in order.
4. A function to free the entire tree. Your program should not have any memory leaks.
Your tree must use dynamic memory. There should not be a maximum number of elements allowed. Submit
all C files, header files, and your makefile on T-Square. In addition, be sure that all code files are .c files and
not .cpp files. If you use .cpp, the compiler does not enforce proper C syntax.
As before, include the following in the top of your main file:
///////////////////////////////////////////////////////////////////////
// Name: //
// Prism Account: //
// Collaboration: //
// “I worked on the homework assignment alone, using only //
// course materials.” //
// or //
// “I received outside aid on this assigned from the following //
// person(s): //
///////////////////////////////////////////////////////////////////////
1