1.

Which of the following data structure can provide efficient searching of the elements?(a) unordered lists(b) binary search tree(c) treap(d) 2-3 treeQuestion is from B-Trees in chapter B-Trees of Data Structures & Algorithms IThe question was posed to me in final exam.

Answer»

The correct choice is (d) 2-3 tree

Easiest explanation - The average case time for lookup in a BINARY search tree, treap and 2-3 tree is O(LOG n) and in unordered LISTS it is O(n). But in the worst case, only the 2-3 trees perform lookup efficiently as it takes O(log n), while others take O(n).



Discussion

No Comment Found

Related InterviewSolutions