Programming Assignment #3
CS163: Data Structures
Problem
Statement:
Hopefully you learned some
interesting concepts when implementing the hash table in program #3. Now, you
will take that same program and apply it to a binary search tree. You will
compare the performance of insertion, search, and removal in comparison to what
was implemented with program #3. When evaluating performance consider what the
height of your BST is…and how that compares to a tree that is balanced
(although there is NO requirement for YOUR tree to be balanced!!).
Again you will be working
with digital pictures and organizing what folders/files and subjects that
relate to the pictures. A picture can have multiple subjects that each need to
have inserted into the BST that you will be implementing in program #4.
Abstract
Data Type:
Write a C++ program that
implements and uses a BST table
abstract data type to store, retrieve, display in sorted order, and remove picture
file locations and their subject lists. (Again, one picture might have more
than one subject – it could be both friends and family for example.)
What does retrieve
need to do? It needs to supply back to the calling routine information about all
of the picture files that have a matching subject. Retrieve, since it is an ADT
operation, should not correspond with the user (i.e., it should not
prompt, echo, input, or output data).
Evaluate the
performance of storing and retrieving items from this BST. Implement the
abstract data type using a separate header file (.h) and implementation file
(.cpp). Only include header files when absolutely necessary. Never
include .cpp files!
Syntax
Requirements:
1) Use iostream.h for all
I/O; do not use stdio.h
2) Implement the table ADT
as a class; provide a constructor and a destructor.
3) Make sure to protect the
data members so that the main() program does not have direct access.
4) Allow the user to
interactively insert, delete, display or retrieve.
REMINDERS: Every program must have a comment at the beginning with your first and last name, the class (CS163) and section, the name of the
file, and the assignment number.
Don’t forget to write the design document! This is essential!