7

Hashing and Hash Tables

Hash Tables Hash Tables

Contents

  • Alternative means of accessing arrays
  • Hashing algorithms and hash tables
7.1 INTRODUCTION

In Chapter 6, we considered two methods for locating items in an array, depending upon whether or not it is in sorted order. The Big-O relationship was established for binary and linear searches. There is an alternative means of organizing an array so that an item may be retrieved ‘directly’ from its location. This makes the operation more efficient, even more so than binary search. In this chapter, we examine this model and its potential advantages.

7.2 AN ALTERNATIVE ARRAY STORAGE MODEL

Imagine a small ...

Get Introducing Data Structures with Java 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.