Skip to Main Content
Beginning Java Data Structures and Algorithms
book

Beginning Java Data Structures and Algorithms

by James Cutajar
July 2018
Beginner content levelBeginner
202 pages
5h 4m
English
Packt Publishing
Content preview from Beginning Java Data Structures and Algorithms

Dealing with Collisions with Open Addressing

In the previous section, we saw how we can deal with collisions using linked lists at each array position. A chained hash table will keep on growing without any load limit. Open addressing is just another way of tackling hash collisions. In open addressing, all items are stored in the array itself, making the structure static with a maximum load factor limit of 1. This means that once the array is full, you can't add any more items. The advantage of using open addressing is that, since you're not using linked lists, you're saving a bit of memory since you don't have to store any pointer references.

You can then use this extra memory to have an even larger array and hold more of your key value pairs. ...

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

Java 9 Data Structures and Algorithms

Java 9 Data Structures and Algorithms

Debasish Ray Chawdhuri
Object-Oriented Data Structures Using Java, 4th Edition

Object-Oriented Data Structures Using Java, 4th Edition

Nell Dale, Daniel T. Joyce, Chip Weems

Publisher Resources

ISBN: 9781789537178Supplemental Content