Which of the following data structure can provide efficient searching of the elements?
Asked In:
BPSC TRE 3.0
Which of the following data structure can provide efficient searching of the elements?
(d) treap
(b) 2-3 tree
(c) unordered lists
(a) binary search tree
Options
A.
treap
B.
2-3 tree
C.
unordered lists
D.
binary search tree
Correct Answer (Detailed Explanation is Below)
B.
2-3 tree
Detailed Explanation
While multiple structures in the list offer efficient searching, the 2-3 tree is considered the most reliable for efficient searching because it is perfectly balanced by design.
Worst-Case Efficiency: A 2-3 tree guarantees a worst-case search time of O(logn)
. Unlike a standard Binary Search Tree, it automatically maintains its balance, ensuring the tree never becomes skewed or "degenerate".
Structure: Every internal node has either 2 or 3 children, and all leaf nodes are at the same level, which keeps the search path consistently short.