hw6 - COP 3530 Fall 2010 Data Structures and Algorithms...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
COP 3530 Fall 2010 Data Structures and Algorithms Assignment 6 Due: Nov 05, 2010 The purpose of this assignment is to implement a Parse Tree Data Structure using Binary Trees to evaluate simple mathematical expressions involving binary operators. The Assignment is divided into 2 parts as follows 1) Implementing Parse Tree Class (Source Code) 40 points 2) Deploying a working Evaluation Program. - 60 points Part I 40 Points In the first part of the assignment you have to implement a simple Parse Tree evaluation class that contains two data members namely a Binary Tree and a String. The class must provide methods that initialize a new object using the user String. i.e take user input as string and initialize the Parse Tree object with the string and and an empty Binary tree. Then you must provide a method generateTree() to populate the tree as a Parse tree of the expression stored in the string. Then you are required to implement a method evaluate() that evaluates the expression using a post order traversal of the binary tree. You can use any method of evaluation using the traversal as you like. One simple method is to Perform a post order traversal of the tree and push each element in turn onto a
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

hw6 - COP 3530 Fall 2010 Data Structures and Algorithms...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online