Question:

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: Sep 25, 2025
  • Binary Search
  • Hashing
  • Linear Search
  • Jump Search
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation


Step 1: Analysis of Search Techniques.
- **Binary Search**: The search time in binary search is dependent on the number of elements, specifically **$O(\log n)$**. It works on sorted arrays.
- **Hashing**: In hashing, the time for searching an element is independent of the number of elements, assuming a good hash function and proper collision resolution, giving **$O(1)$** average time complexity.
- **Linear Search**: The search time in linear search is **$O(n)$**, dependent on the number of elements, as it checks each element one by one.
- **Jump Search**: Jump Search also depends on the number of elements but has a time complexity of **$O(\sqrt{n})$**.

Step 2: Conclusion.
The correct answer is **(2) Hashing**, as search time is independent of the number of elements.

Was this answer helpful?
0
0

Questions Asked in CUET PG exam

View More Questions