1.

Which of the following is false?(a) Binary tree sort and quick sort have same running time(b) Binary tree sort used BST as work area(c) As the number of elements to sort gets larger, binary tree sort gets more and more efficient(d) Both quick sort and binary tree are in place sorting algorithmsThis question was addressed to me in an online quiz.The above asked question is from Sorting in portion Sorting of Data Structures & Algorithms II

Answer»

Right answer is (d) Both quick sort and BINARY tree are in place SORTING algorithms

To explain: Binary tree sort and quick sort have same running TIME i.e O(nlogn)

in average CASE and O(n^2) in worst case. Binary tree is not in-place sorting ALGORITHM.



Discussion

No Comment Found

Related InterviewSolutions