Suggest an editImprove this articleRefine the answer for “What is a "bucket" in the context of a hash table?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)A **bucket** is a slot in a hash table where elements whose keys hashed to **the same index** are stored. **Key point:** buckets exist to resolve collisions - to hold multiple elements that landed in the same slot.Shown above the full answer for quick recall.Answer (EN)ImageA **bucket** is a slot in a hash table where elements whose keys hashed to **the same index** are stored. ## How it works 1. The hash function computes the index for a key: ```javascript index = hash(key) % N ``` 2. All elements for which this index matches land **in the same bucket**. 3. If there are several such elements, this is a **collision**, and the bucket stores all of them (for example, as a list). ## Example If `hash("cat") % 10 = 3` and `hash("dog") % 10 = 3`, both elements will sit in the bucket with index `3`. ```javascript bucket[3] → [("cat", "meow"), ("dog", "woof")] ``` ## Purpose Buckets exist to **resolve collisions**: to hold multiple elements that landed in the same slot. In other words, a **bucket** is a mini storage inside a hash table, which can hold **one or several** "key -> value" pairs with the same hash index.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.