4. Tree Traversals #
Created Wednesday 29 January 2020
We have already done these
- Print basic, print root, then print left subtree and then the other subtrees. - PreOrder (NLR)
- Level wise, using queue - **LevelOrder **(Independent).
Trees are having simple problems mostly. Recursion is the primary weapon.
- inOrder traversals: Print the left(immediate i.e at(0)) subtree, print the root, print the other subtrees. abdul bari sir’s method is not useful.
- postOrder traversals: Print all the subtrees then print the root.
- left right is a bad terminology for trees, children number is better. We will use elder of children which come first, i.e towards left in the vector.