# What are the different tree traversal techniques

To traverse a binary tree means to visit each node of the tree exactly once in a systematic fashion.

Binary tree is non-linear data structure. Hence, we can’t traverse it like a linked list is a sequential manner but it requires a different approach.

We mainly have three algorithms for traversing binary tree. A. Pre-order Traversal

B. In-order Traversal

C. Post-order Traversal

Consider the Tree

Pre-order traversal:-To traverse a non-empty binary tree by pre-order method, the following operations are performed recursively until all nodes are visited: i. Visit the root node. ii. Traverse the left sub-tree fully. iii. Traverse the right sub-tree.

The pre-order traversal of above tree is A,Q,W,Z,C,H,G,D

In-order Traversal:- To traverse a non-empty binary tree by in-order method, the following operations are performed recursively until all nodes are visited:

i. Traverse the left sub-tree.

ii. Now, visit the root node.

iii. Then, finally traverse the right sub-tree.

The in-order traversal of the tree is Q, Z, W, C, A, H, D, G

- Post-Order traversal:- To traverse a non-empty binary tree by post-order method, the following operations are performed recursively until all nodes are visited:

i. Traverse the left sub-tree.

ii. Now, move to the right sub tree

iii. Then, finally visit the root node.

The post-order traversal of the tree is Z, C, W, Q, D, G, H, A

- What are geological materials
- Whats the best coat brand
- What is used to manufacture ink
- Is sperm donation lucrative
- Where can I find paid fashion internships
- Who should I show my prototype to
- Is the phrase how do so correct
- How would you define utility in economics
- What is the best topics in events
- Where did the Basque people come from
- How cold does it get in Spain
- Whats the grade system in China
- Why cant men wear mehndi
- Is poultry farming a profitable business
- Recommendations for sad romantic instrumental songs
- Who was the first finance minister
- Can you grill meat with a flamethrower
- Is it possible to have fraternal triplets
- What is ubers customer care number