...
Sorting
October 13, 2023
OOPS
October 13, 2023
Sorting
October 13, 2023
OOPS
October 13, 2023

Nielit STA 17-12-2017

Question 2
In binary search tree which traversal is used for getting ascending order values?
A
Inorder
B
Preorder
C
Postorder
D
None of the above
Question 2 Explanation: 
To traverse a binary search tree in inorder following operations are carried-out
(i) Traverse the left most subtree starting at the left external node,
(ii) Visit the root, and
(iii) Traverse the right subtree starting at the left external node.
The Inorder traversal of the above tree will outputs: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Correct Answer: A
Question 2 Explanation: 
To traverse a binary search tree in inorder following operations are carried-out
(i) Traverse the left most subtree starting at the left external node,
(ii) Visit the root, and
(iii) Traverse the right subtree starting at the left external node.
The Inorder traversal of the above tree will outputs: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

Leave a Reply

Your email address will not be published. Required fields are marked *