1.

Which of the following version of tree sort will have the highest worst case time complexity?(a) using AVL tree as BST(b) using red black tree as BST(c) using splay tree as BST(d) using ordinary BSTThis question was addressed to me in exam.My question is based upon Sorting in portion Sorting of Data Structures & Algorithms II

Answer»

Right answer is (d) using ordinary BST

Explanation: Out of the given options TREE SORT has the highest worst CASE TIME complexity with ordinary BST as it may not be balanced in every case. Whereas all other options have SELF balancing BST.



Discussion

No Comment Found

Related InterviewSolutions