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: 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:


Ileana Streinu