What is the time complexity of insert function in a hash table using a doubly…

2024

What is the time complexity of insert function in a hash table using a doubly linked list?

  1. A.

    O(1)

  2. B.

    O(n)

  3. C.

    O(log n)

  4. D.

    O(n log n)

Attempted by 192 students.

Show answer & explanation

Correct answer: A

Answer: a

Explanation: Time complexity of insert function in a hash table is O(1). Condition is that the number of collisions should be low.

Explore the full course: Coding For Placement