Suggest an editImprove this articleRefine the answer for “What is the complexity of accessing an element in a hash table?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)The average **time complexity of accessing (looking up) an element** in a hash table is **O(1)**, that is, constant time. **Key point:** in the worst case, if all elements produced the same hash, lookup turns into O(n), since the entire chain must be walked.Shown above the full answer for quick recall.Answer (EN)ImageThe average **time complexity of accessing (looking up) an element** in a hash table is **O(1)**, that is, constant time. **Why O(1):** 1. The hash function computes the index in fixed time. 2. The table accesses the right slot (bucket) directly. 3. On average, a bucket holds 1 element or very few. **In the worst case:** If all elements produced the same hash (maximum collisions), they all end up in one bucket, and the lookup turns into **O(n)**, the entire chain has to be walked. **Summary:** - **Average complexity:** O(1) - **Worst-case complexity:** O(n) - **Amortized (in practice):** O(1) with a good hash function and a balanced table.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.