Binary Trees (3/3)

Video Details
Youtube Description
Binary Trees Part 3: expression trees, infix, prefix, postfix notations, evaluating trees and expressions.

NOTE: The ending was cut off. The postfix expression evaluation algorithm essentially steps through all the elements of the expression (operators and operands). When it meets an operand (variable, digit), it pushes it onto the stack. When it meets an operator, it pops two operands from the stack, performs the operation defined by the operator on those two operands, and then pushes the result onto the stack. At the end of the expression, we will have our result in the stack.

In response to a question in the comments about building a tree from a prefix notation: http://pastebin.com/Mmaa3FMU
Videos in Current Module