# Traversal in Binary Trees

Traversal means to **move across/visit **each and every **node** in the tree.There are three techniques to traverse a Binary Tree :

- Preorder
- Inorder
- Postorder

### Preorder traversal

In preorder traversal,firstly the **root** is traversed then **left subtree** and in the last** right subtree**(Fig 1)**.**

### Example

Consider the following binary tree(Fig 2) :

**Root** is traversed in the **beginning** so **10** is** visited** at the **firs**t.After this **left sub-tree** is traversed. (Fig 3). In the** left subtree** **22** is the root of **44** and **25**,so** 22** is visited after 10 followed by left child i.e.**44**.**25** is the **right child** and is the root node of **17** and **88**.**44** is followed by **25** then **17** and **88**.After visiting left sub-tree traversal of right subtree is done.**13** is visited and followed by left child i.e.**46**.

### Inorder Traversal

In In-order traversal,**left subtree** is traversed in the **beginning ** followed by **root ** which is further followed by **right sub-tree**(Fig 4).

### Example

Consider the following binary tree(Fig 5) :

### Post Order Traversal

In post-order traversal left subtree is traversed first followed by right subtree and further followed by root.

Consider the following binary tree(Fig 5) :

## Comments

So empty here ... leave a comment!