C program to print binary tree

C program to print binary tree

Binary Tree:

    5
 /    \
3      7
/ \     / \
      2   4  6   8
      /
  1

Output:

Inorder Traversal of the binary tree:
1 2 3 4 5 6 7 8
Preorder Traversal of the binary tree:
5 3 2 1 4 7 6 8
Postorder Traversal of the binary tree
1 2 4 3 6 8 7 5

Implementation: