Tree Traversal
Tree Traversal is the process of visiting/processing every node in a tree using a consistent method. Every traversal algorithm, has a time complexity in Big-Oh Notation $O(n)$ where n is the number of nodes in the tree. There are two types of three traversal methods:
- Depth First: In this method, we go down each subtree of a node before visiting other nodes, so the nodes at lower heights aren’t necessarily prioritized. There are two algorithms for this:
- Breadth First Traversal.