Computer Science · Data Structures
Suppose a binary search tree has been constructed from the following sequence of numbers in the order in which they arrive: 6, 2, 10, 1, 5, 7, 11, 3, 9, 4, 8. Consider the following piece of code: Show(root) { if (root != NULL) { printf('%d ', root->key); Show(root->right); Show(root->left); } else return; }The sequence printed by calling Show(root) will be:
- 16, 10, 2, 11, 7, 9, 8, 5, 3, 4, 1
- 26, 10, 11, 7, 9, 8, 2, 5, 3, 4, 1✓
- 36, 11, 7, 9, 8, 10, 2, 5, 1, 3, 4
- 46, 11, 10, 7, 8, 9, 2, 4, 3, 5, 1
Correct answer
6, 10, 11, 7, 9, 8, 2, 5, 3, 4, 1
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on Data Structures?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · Data Structures