You are on page 1of 1

Assignment-3

Deadline 30-Sept-2011 Your task is to implement Expression Tree as discussed in the class. a) Read the infix expression from infix.txt which has the following format Sample infix.txt a+b*c/d+(e+f)*(f/d*e) b) Read the variable values from value.txt which has the following format a 60 b 20 c 35 c) Build the expression tree for the expression read in part (a). d) Write an algorithm to evaluate the expression stored in expression tree. You have to use the tree to evaluate the expression. [Hint: Use the depth of the tree and evaluate the lower part of the tree and trim it accordingly].

You might also like