CS 112
Final Project
Due: Thursday,
May 3
by 8:00 a.m.
5-10 Minute In-class presentation on Th May 3, 8:00-10:20.
The final project asks for the implementation in C++ of a
comprehesive set of tree classes (plain binary tree, binary
search tree, arithmetic expression tree and general -
unrestricted - tree). You will
"present" the project to me (Ileana) in the last day of
classes. I.e. you will run the program for me and show me its
various features, as well as be ready to answer any questions I
might have regarding the way it was done.
The program
builds on Homework 10 by reusing (and perhaps enhancing) the
following features:
- A menu-driven user interface. There should be an option for
each of the functions already implemented in Hw10, as well as for the new ones
described below.
- A set of abstract data types implemented as a C++ classes
called BinTree (for a general purpose binary tree), BinSearchTree
(for a binary search tree), AETree (for an arithmetic expression
tree) and Tree (for a general tree, with no restriction on the
number of children).
- Each class should contain ALL the necessary member functions
that will allow the user to create, destroy, navigate, test, insert and
delete nodes in the tree, and traverse the tree in prefix,
postfix and infix (for binary), or prefic and postfix, for a
general tree. They should also contain functions that
apply to specific types of trees (such as reading an array to create a
binary search tree or traversing it to sort, etc. see Hw 10).
To get a minimum passing grade on the project (C), you should submit at least
a complete solution to a general binary tree class, as described
in Hw10 (fully working and including
typescript showing thorough testing).
Building on this, and for increased final project grades, you will
include new features. Please add them incrementally, test them
thoroughly and be ready to submit the highest level version you
have completed, rather than attempting a complete program that
does not work at all. Remember that among the skills I am
testing you on with the final project are your improved software
engineering abilities, including the development and testing of
software, code reuse, documentation and readability for easy
maintenance.
Some of the functions requested for Hw10 can be done relatively
easily using recursion (such as the function to convert a fully
parenthesized arithmetic expression to an arithmetic expression
tree). Some can be done both iteratively and recursively. While I
will take into account the elegance of your solution, there will
be no explicit penalty for using an iterative solution instead of
a recursive one, when that is possible.
Any extra feature that you successfully implement (even if not
explicitly asked for, such as templated classes) will count as
extra credit and will add points to your grade on the project.
Besides this, I am asking you to implement some extra features
that would help turn the last part of this project (the general
tree class) into a "Unix shell
simulator" for a "Unix-like file system", implemented as a
tree, as discussed in class.
To simplify the implementation,
your "directories" and "files" will be identified by integer ids (e.g. 1,2,
3 etc), not by a string. The user will then be able to perform
operations such as "cd" to navigate in the hierarchy of files, ls
to list the files in a certain directory or all of them, "rm" or
"rmdir" to remove files and directories, and mkdir and "emacs"-like
commands to create a file (e.g. "mkdir 3" or "emacs 2", to create
a directory named 3 or a file (leaf) named 2).
Roughly: implementing the basic functions (including navigation,
insertion and deletion of nodes and traversal) in all the classes is
worth a B, and a complete
solution to all the requested features gives you an A-.
"Complete" means everything: it compiles, it works, shows
sound programming style, it is
thoroughly tested, well documented, readable, nice
user-interface, clean typescript, and is submitted in time.
To get an A, you must give nice, clean and elegant solutions
(most likely, recursive) to the special functions in the
Arithmetic Expression Tree and Binary Search Tree classes, and
contribute something special (e.g. code reuse or
templates, or anything that you feel is particularly suitable for
this project).
To submit:
- For the final project, submit all the relevant files (.cpp,
.h, Makefile and typescript with a comprehensive set of tests)
as:
submit Project files
- Print the typescript and next to each input test data,
draw (by hand) the corresponding tree, to make it easy
for me to interpret the results.
- Write on the typescript the level you have accomplished with
the project (e.g. "I implemented general Binary Trees and Binary
Trees, but not Arithmetic Expression Trees, and my general Tree
is not fully debugged").
Ileana Streinu