Creating a Binary Tree

Raman009 (124)
Hello there,
If I add the following numbers in a binary tree in the same sequence
30 , 40 ,35 , 25 , 50 , 45
what should be the inorder , postorder and preorder traversal ?

My program gives :
InOrder 25 , 30 , 35 , 40 , 45 , 50

PostOrder 25 , 35 , 45 , 50 , 40 , 30

PreOrder 30 , 25 , 40 , 35 , 50 , 45

Please match it with your program/algorithm and check my answers.
Registered users can post here. Sign in or register to post.