Loading tutorials
Intermediate · Mid: 16 chapters · 37 min read. States assumed prerequisites
Start reading%). It covers how a hash function turns a key into an integer and what makes one good or bad. Reducing that integer to a bucket index comes in the next chapter.%, and the idea of a hash function that turns a key into an integer. Here we cover the step after hashing: turning that integer into a valid position in the array.hash(key) % size gives a bucket index. It also assumes basic Big-O and Python. Here you will see why two keys sometimes land in the same bucket, and why no clever design removes that possibility.hash(key) % size selects a bucket index. It also assumes you know that two different keys can land in the same bucket. Here you will see the most direct fix for that: separate chaining.hash(key) % capacity and with the idea that a bucket is a slot in an array.