Computer Science Project

profileNectarini
extra_credit.pdf

1

COMP 182 Fall 2016

Extra Credit Project 6 Binary Search Trees

Design and implement a class for a simple infix algebraic equation calculator using any method learned in

class (Stacks, Recursion, Binary Trees…)

Example: You may use the algorithm given in the Programming Problems for Chapter 7, Problem 9 (Page

402 of the 3rd Edition of the textbook) to convert the infix expression to prefix as an interim step.

Note: Please provide adequate documentation and justification on the algorithm used with explanation on

how the algorithm with interim print out.

Input Example:

3 * (5 + 7)

Output Example (prefix):

3 * (5 + 7) is converted to the equivalent prefix expression *3+57 sing a Stack ATD

Answer: 36

Output Example (BST):

3 * (5 + 7) is converted to the equivalent BST ADT of height 2 and 5 notes

Answer: 36