Which of the following data structure can provide efficient searching of the elements?

Category: QuestionsWhich of the following data structure can provide efficient searching of the elements?
Editor">Editor Staff asked 5 months ago

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 tree
 
Question is from B-Trees in chapter B-Trees of Data Structures & Algorithms I
 
The question was posed to me in final exam.

1 Answers
Editor">Editor Staff answered 5 months ago

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).


Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17
Articles: 40701