‫So in this video, we're going to talk about collisions.
‫So I'm going to bring up an address space and add some items to our hash table.
‫And a collision is when we have a key value pair that's going to map to the same address as another
‫key value pair.
‫And one of the ways that we can handle this is just by putting both of them at the same address.
‫And when we do this, it's called separate chaining.
‫And this is the most common way of handling collisions in a hash table.
‫But now let's look at another way of handling collisions.
‫That's probably the second most common way.
‫And with this way, we do not store both of them at the same address.
‫If there's a duplicate, will look to the next index to see if that is empty.
‫And if it is, we'll store it there.
‫And if we have another item that maps to that address, we'll just start moving through the indexes
‫until we find one that's empty and store it there.
‫This method is called linear probing, and it is a form of open addressing.
‫Now, the way we'll do it in this course is we're going to store all of these at the same address,
‫which is separate chaining, but it is not going to look exactly like this.
‫The way we're going to do it is with a linked list at each one of these indexes.
‫And that is how we will deal with collisions.