Skip to main contentSkip to solution

The time complexity of Hashing is :-

Solution

✅ Correct Option: 1

Hashing uses a hash function to convert a key directly into an array index, so search, insert and delete go straight to that location without scanning other elements. With a good hash function and few collisions, each operation takes constant time, O(1)O(1), on average.


Option 2: O(n)O(n) is the worst case, when all keys collide into one bucket and must be searched one by one. It is not the standard complexity of hashing.

Option 3: O(log⁡2n)O(\log_2 n) is the complexity of binary search and balanced trees, which are not hashing.

Option 4: O(n2)O(n^2) has no link to basic hash table operations.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question