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


    Question

    Which of the following data structures offers O(1)

    average-case time complexity for insertion, deletion, and search operations?
    A Sorted Array Correct Answer Incorrect Answer
    B Linked List Correct Answer Incorrect Answer
    C Binary Search Tree Correct Answer Incorrect Answer
    D Hash Table Correct Answer Incorrect Answer
    E Heap Correct Answer Incorrect Answer

    Solution

    Hash tables, when implemented with a good hash function and collision resolution strategy, provide average-case O(1) time complexity for these operations. Worst-case can be O(N) in case of many collisions.

    Practice Next
    ask-question