Skip to Content
C++ Data Structures and Algorithms
book

C++ Data Structures and Algorithms

by Wisnu Anggoro
April 2018
Intermediate to advanced content levelIntermediate to advanced
322 pages
6h 57m
English
Packt Publishing
Content preview from C++ Data Structures and Algorithms

Applying a HashTable ADT using a separate chaining technique in the code

Before we apply the HashTable ADT using the separate chaining technique to the code, let's see how a separate chaining technique works to handle collisions. First, we have phone number 434, owned by Dylan. The phone number will generate 0 for the hash key, so the data will be stored in cell 0. 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 cell 2; and phone number 669, owned by Terry in cell 4.

By now, everything has been running well, since no collision has occurred; however, if we store the 7th data to the hash ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Data Structures and Algorithms Using C++

Data Structures and Algorithms Using C++

Ananda Rao Akepogu, Radhika Raju Palagiri
C++ Data Structures and Algorithm Design Principles

C++ Data Structures and Algorithm Design Principles

John Carey, Anil Achary, Shreyans Doshi, Payas Rajan
C++ Plus Data Structures, 6th Edition

C++ Plus Data Structures, 6th Edition

Nell Dale, Chip Weems, Tim Richards

Publisher Resources

ISBN: 9781788835213Supplemental Content