edited by
23,658 views
25 votes
25 votes

Suppose the numbers $7, 5, 1, 8, 3, 6, 0, 9, 4, 2$ are inserted in that order into an initially empty binary search tree. The binary search tree uses the usual ordering on natural numbers. What is the in-order traversal sequence of the resultant tree?

  1. $7 \ 5  \ 1 \ 0 \ 3 \ 2 \ 4 \ 6 \ 8 \ 9$

  2. $0 \ 2 \ 4 \ 3 \ 1 \ 6 \ 5  \ 9  \ 8  \ 7$

  3. $0 \ 1 \ 2 \ 3 \ 4 \ 5 \ 6 \ 7 \ 8 \ 9$

  4. $9 \ 8 \ 6 \ 4  \ 2  \ 3 \ 0 \ 1 \ 5 \ 7$

edited by

3 Answers

Best answer
33 votes
33 votes

In-order traversal returns the elements in ascending (smallest to largest) order.

Therefore, correct option C

edited by
0 votes
0 votes
Inorder traversal on BST gives sequence in increasing order(not just Sorted Order)

so Answer is C
Answer:

Related questions

20.6k
views
4 answers
65 votes
Kathleen asked Sep 17, 2014
20,580 views
A data structure is required for storing a set of integers such that each of the following operations can be done in $O(\log n)$ time, where $n$ is the number of elements...
15.0k
views
5 answers
51 votes
Kathleen asked Sep 16, 2014
15,048 views
Which of the following scenarios may lead to an irrecoverable error in a database system?A transaction writes a data item after it is read by an uncommitted transactionA ...
30.1k
views
6 answers
57 votes
Kathleen asked Sep 17, 2014
30,061 views
The subnet mask for a particular network is $255.255.31.0.$ Which of the following pairs of $\text{IP}$ addresses could belong to this network?$172.57.88.62$ and $172.56....
15.3k
views
5 answers
45 votes
Kathleen asked Sep 16, 2014
15,335 views
Using a larger block size in a fixed block size file system leads tobetter disk throughput but poorer disk space utilizationbetter disk throughput and better disk space u...