Notes for assignment # 3

  1. Instead of the Expression class use BXTree class discussed in LEC10.DOC and LEC11.DOC

  2. Ignore 33(d) and 33(e)

  3. For part (a) write a member function for BXTree called fullParanthesis(). It will be a recursive function similar to InOrder traversal. You don't need any parameters.
    Algorithm for the private version (with one parameter) will be:

if(!t) return;
if(t->data.IsOperator())

cout << " ( ";
fullParanthesis(t->LeftChild);
cout << ' ' << t->data << ' ';
fullParanthesis(t->RightChild);
cout << " ) ";

else

cout << ' ' << t->data << ' ' << endl;

  1. Main program accepts a prefix expression outputs its postfix and fully parathesized infix equivalent as well as the value.