This is an individual assignment. Seeking direct help from students, tutors, and websitessuch as chegg or stack overflow will be construed as a violation of the honor code.
Semester Project Part 3: Managing the Stuff in my Closets using STLs
and BSTs.
Data Structures and Analysis of Algorithms, akk5
Objectives
•
•
•
•
To strengthen student’s knowledge of C++ programming
To give student experience reading and parsing strings of commands
To give student experience in writing a non-linear data structure
To give the student experience implementing a BST
Instructions
For this assignment you must write a program that implements and manages several user defined BSTs.
Each BST will represent a container/location and the inventory of items it stores. This means that your
BSTs should store the name of the container/location and a collection of items; each item will have a
name and how many of them are in the container. You should use the name of each item as your key
for creating the BST; should a user attempt to add more of the same item, just update the item count
through addition. You can use the list or vector STL to manage your collection of BSTs.
Your program should implement a command line (text-based interface) capable of handling the
following commands:
exit – exits the program
load – parses the contents of the file as if they were entered from the command line
display in – displays the contents of the specified container in order
display pre – displays the contents of the specified container pre order
display post – displays the contents of the specified container post order
find – searches each container for the specified item, displaying the container name,
item name, and item count each time it is found. Should inform the user on a failure.
find in – searches the given container for the specified item, displaying the
item name and item count if it is found. Should inform the user on a failure.
remove – Removes the specified item from each container. Should inform the user on a
failure.
remove from – Removes the specified item from the given container.
Should inform the user on a failure.
This is an individual assignment. Seeking direct help from students, tutors, and websites
such as chegg or stack overflow will be construed as a violation of the honor code.
insert into – Inserts count of the specified item into the given
container.
create – Creates the specified container and adds it to the list of containers. Should
report failure if a container of the same name already exists.
destroy – Destroys the specified container and its contents. Should report failure if
a container of that name doesn’t exist.
Guidance
Both your BST class and your Node class will have to store additional data for this project to work. Keep
that in mind as you plan and implement your program.
Pay close attention to your Node class, you can benefit from overloading the , ==, and