1.

Which of the following traversal in a binary search tree results in a sorted output?(a) in order traversal(b) pre order traversal(c) post order traversal(d) breadth first traversalThis question was posed to me in semester exam.My doubt stems from Sorting in chapter Sorting of Data Structures & Algorithms II

Answer»

The CORRECT choice is (a) in ORDER traversal

The best I can EXPLAIN: Tree sort uses a binary search tree for sorting the given elements. FIRST a BST is formed by using the input data elements and then the BST is traversed in an in order FASHION which gives a sorted output.



Discussion

No Comment Found

Related InterviewSolutions