Recursion
An algorithm or subroutine that is defined in terms of itself
Characteristics of a recursive algorithm (3)
How to store a binary tree if you were gonna program with it
A list of records. Each record holds the left branch index, right branch index and the data
Pseudocode for in-order traversal
Traverse left subtree
Visit this node (the parent of the two subtrees)
Traverse right subtree
Pseudocode for pre-order traversal
Visit this node (the parent of the two subtrees)
Traverse left subtree
Traverse right subtree
Pseudocode for post-order traversal
Traverse left subtree
Traverse right subtree
Visit this node (the parent of the two subtrees)
Use of a pre order traversal
Copying a tree
Use of an in order traversal
Outputting the contents of a binary search tree in ascending order
Use of a post order traversal (2)
Converting infix to postfix (Reverse Polish Notation), emptying a tree