CPSC 221H-200: Data Structures & Algorithms
Programming Assignment #3
Spring 2009


General Guidelines for Programs


Assignment

Design Due: Thursday February 26, 2009 in lab. The code design should be submitted in hardcopy at the beginning of lab.

Code Due: Wednesday March 4, 2009 by midnight => Extended March 9, 2009. Code (including Makefile or .sln file) should be turned in electronically using the mechanism described above.

Project Report Due: Monday March 9, 2009 by midnight => Extended March 13, 2009.

Schedule.

This programming assignment is to solve the fully parenthesized arithmetic expression problem with multiple data structures.

The fully parenthesized arithmetic expression problem includes expressions such as (((x1+x2)*(x1-x3))/(x2*x3)). Current operators in expression include +,-,*, and /, but this set may be extended to include additional operators taking two operands.

You will create two implementations, one with a Stack and one with a Tree. You will work in a group of two students; each student in the group will provide the implementation using one of the above data structures, but not the same data structure as their partner. The operands x1, x2, x3 and etc. are variables. But later operands may include constants.

Data Format.

Coding Portion. (50 points)

You should coordinate with your partner about who will be the primary coder of the Stack and the Tree implementation; each partner must code one portion. You need to design the algorithm and program for this problem by yourself. You may use the Standard Template Library (STL).

You will turn in your proposed design, including class definitions, interface designs of your solution, and data structure(s) to use on Thursday, February 26, 2009 at the beginning of lab. The complete program will be due on Monday, March 9, 2009 as described above. The initial design will be worth 15 points and the final program will be worth 35 points.

Report. (50 points) Due: March 13, 2009

The objective of your report will be to compare the Tree and Stack approaches. You will trade code with your partner and individually you will each compare the two approaches both theoretically and experimentally. You will write a brief report that includes theoretical analysis, a description of your experiments, and discussion of your results. At a minimum, your report should include the following sections:

  1. Introduction. In this section, you should describe the objective of this assignment.
  2. Theoretical analysis. In this section, you should
  3. Experimental Setup. In this section, you should provide a description of your experiment setup, which includes but is not limited to
  4. Experimental Results. In this section, you should compare the performance (running time) of the experiments to their theoretical complexity.
  5. Conclusion. In this section, you should summarize your thoughts and opinions about this assignment.