A binary search tree contains the value 1,2,3,4,5,6,7,8. The tree is traversed…
GATE · 1997 · CS · Question 4 subparts
A binary search tree contains the value 1,2,3,4,5,6,7,8. The tree is traversed in pre-order and the values are printed out. Which of the following sequences is a valid output?
- A.
5 3 1 2 4 7 8 6
- B.
5 3 1 2 6 4 8 7
- C.
5 3 2 4 1 6 7 8
- D.
5 3 1 2 4 7 6 8
Attempted by 153 students.
Show answer
Correct answer: D
The worked solution is available to enrolled students.
Video solution available to enrolled students.
Explore the full course: Iocl Engineers Officers Grade A Paper 2
Loading lesson…