Basic Exhaustive Tree Search
4 canonical orderings
Preorder: root, left subtree, right subtree
Inorder: left subtree, root, right subtree
Postorder/depth first: left subtree, right subtree, root
Breadth first: root, 1st ply, 2nd ply, etc.
C
A
+
*
+
B
D
Pre: *+ab+cd
In: a+b*c+d
Post/DFS: ab+cd+*
BFS: *++abcd
Previous slide
Next slide
Back to first slide
View graphic version