Data Structure Time Complexity Question #15249
Single Choice Easy

QWhat is the time complexity of a hash table's average-case search operation?

ID: #15249 Time Complexity 145 views
Question Info
#15249Q ID
EasyDifficulty
Time ComplexityTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A O(1)
  • B O(log n)
  • C O(n)
  • D O(n log n)
Correct Answer

Explanation

Hash tables use a hash function to map keys to array indices, allowing constant-time access to elements. In the average case, the hash function distributes the keys evenly, resulting in a constant number of probes to find the desired element. As a result, the time complexity of a search operation in a hash table is O(1).

Share This Question

Challenge a friend or share with your study group.