the pre order traversal of binary search tree is 10,5,1,7,40,50 what traversal of the tree?
Answers
Answer:
Explanation:
preorder follows the sequence as 10,5,1,7,40,50 it means root comes first then left subtree and then right subtree.
now the inorder sequence will be 1,5,7,10,40,50
because as this is a binary search tree the inorder will be in increasing order of the elements
postorder follows as:right subtree , left subtree and then root
50,40,7,1,5,10
Answer:
preorder follows the sequence as 10,5,1,7,40,50 it means root comes first then left subtree and then right subtree.
now the inorder sequence will be 1,5,7,10,40,50
because as this is a binary search tree the inorder will be in increasing order of the elements
postorder follows as a right subtree, left subtree, and then root
50,40,7,1,5,10
Explanation:
preorder follows the sequence as 10,5,1,7,40,50 it means root comes first then left subtree and then right subtree.
now the inorder sequence will be 1,5,7,10,40,50
because as this is a binary search tree the inorder will be in increasing order of the elements
postorder follows as right subtree, left subtree, and then root
50,40,7,1,5,10