2.Pre-order Traversal
Pre means root at first.
Pre-order traversal is to visit the root first. Then traverse the left subtree. Finally, traverse the right subtree.
Preorder traversal is used to create a copy of the tree
Iterative Method using stack
Steps:
1. Print a node
2. Add the address to stack
2. Move to left subtree
3. Move to right subtree
Recursive method
Last updated