Applying an HashTable ADT using a linear probing technique in the code

Before we apply the HashTable ADT we built using the linear probing technique previously, we will first see how the linear probing technique handles a collision by applying it to the phone number list we had at the beginning of this chapter. We will also define TABLE_SIZE as 7, which is the same as our previous separate chaining techniques, as a comparison to separate the chaining technique.

First, we have phone number 434 owned by Dylan, which will be stored in cell 0. The next is phone number 391 owned by Dominic, which will be stored in cell 6. Phone number 806 owned by Adam in cell 1, phone number 117 owned by Lindsey in cell 5, phone number 548 owned by Cameron in ...

Get C++ Data Structures and Algorithms now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.