+1 vote
in Data Structures & Algorithms I by (110k points)
In a binary search tree, which of the following traversals would print the numbers in the ascending order?

(a) Level-order traversal

(b) Pre-order traversal

(c) Post-order traversal

(d) In-order traversal

I would like to ask this question from Inorder Traversal topic in section Binary Trees of Data Structures & Algorithms I

I had been asked this question by my school principal while I was bunking the class.

1 Answer

+1 vote
by (672k points)
selected by
Best answer
Right choice is (d) In-order traversal

The best I can explain: In a binary search tree, a node’s left child is always lesser than the node and right child is greater than the node, hence an in-order traversal would print them in a non decreasing fashion.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.