📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    In the context of searching, what is the primary

    advantage of using hashing?
    A Guaranteed O(1) worst-case search time. Correct Answer Incorrect Answer
    B Efficient for range queries. Correct Answer Incorrect Answer
    C Allows for very fast average-case search, insertion, and deletion. Correct Answer Incorrect Answer
    D Preserves the order of elements. Correct Answer Incorrect Answer
    E Requires no extra space. Correct Answer Incorrect Answer

    Solution

    Hashing provides an average-case time complexity of O(1) for search, insertion, and deletion operations. While collisions can degrade performance to O(N) in the worst case, a good hash function and collision resolution strategy keep the average performance very high. It does not guarantee O(1) worst-case, nor is it inherently good for range queries or preserving order. It also typically requires extra space for the hash table itself.

    Practice Next
    ask-question