Question 2041 – Nielit Scientific Assistance CS 15-10-2017
November 9, 2023Question 2048 – Nielit Scientific Assistance CS 15-10-2017
November 9, 2023Question 2044 – Nielit Scientific Assistance CS 15-10-2017
A binary search tree contains the values- 1,2,3,4,5,6,7 and 8. The tree is traverses in preorder and the values are printed out. Which of the following sequences is a valid output?
Correct Answer: D
Question 4 Explanation:
Preorder traversal yields (Root, left, right)
Option D:
Let draw binary search tree for the given sequence,
After traversing through this tree we will get same sequence.
Option D:
Let draw binary search tree for the given sequence,
After traversing through this tree we will get same sequence.
5 3 1 2 4 7 8 6
5 3 1 2 6 4 9 7
5 3 2 4 1 6 7 8
5 3 1 2 4 7 6 8
Subscribe
Login
0 Comments