Q. Which of the following traversal methods can be used to obtain a sorted order of a binary search tree?
A.
Pre-order
B.
In-order
C.
Post-order
D.
Level-order
Solution
In-order traversal of a binary search tree visits nodes in sorted order, as it processes the left subtree, then the root, and finally the right subtree.
Q. Which traversal method of a binary tree visits nodes in the order of left child, root, right child?
A.
Pre-order
B.
In-order
C.
Post-order
D.
Level-order
Solution
In-order traversal visits the left child first, then the root, and finally the right child, which results in the nodes being visited in ascending order for a binary search tree.