Back to Resources
Some Notation
Traversals
Since nodes in a tree can have multiple children, there are multiple ways of traversing trees. Here we discuss three main traversals:
Preorder
: Visit the current node, then recursively preorder traverse on the left subtree and right subtree
Inorder
: Recursively inorder traverse on the left subtree, then visit the current node, and then recursively inorder traverse on the right subtree
Postorder
: Recursively postorder traverse on the left subtree and right subtree, and then visit the current node
Types of Trees
Perfect
Complete
Full