1.

Which of the following is not an advantage of tree sort?(a) it has a low space complexity(b) it has good time complexity for balanced BST(c) it is an online sorting algorithm(d) it is stable sorting algorithmI got this question in an online quiz.Question is taken from Sorting in section Sorting of Data Structures & Algorithms II

Answer»

Correct answer is (a) it has a low SPACE complexity

To explain: Tree sort has a linear time complexity O(n) which makes it inefficient. This the MAIN reason why sorting ALGORITHMS LIKE quick sort, HEAP sort etc. are preferred over it.



Discussion

No Comment Found

Related InterviewSolutions