Question:medium

In ................. the search time is independent of the number of elements $n$.

Show Hint

Hashing provides constant-time complexity **$O(1)$** for search operations, which is independent of the number of elements.
Updated On: Mar 7, 2026
  • Binary Search
  • Hashing
  • Linear Search
  • Jump Search
Show Solution

The Correct Option is B

Solution and Explanation

Phase 1: Examination of Search Methodologies.
- Binary Search: Search duration correlates with the element count, specifically $O(\log n)$. Applicable to sorted arrays only.
- Hashing: With a robust hash function and effective collision management, search time is unaffected by the number of elements, yielding an average complexity of $O(1)$.
- Linear Search: Search duration is $O(n)$, directly proportional to the element count, due to sequential checking.
- Jump Search: Search duration is contingent on element count, with a time complexity of $O(\sqrt{n})$.

Phase 2: Determination.
The optimal choice is (2) Hashing, owing to its search time's independence from element count.

Was this answer helpful?
0