Skip to Content
Python Data Structures and Algorithms
book

Python Data Structures and Algorithms

by Benjamin Baka
May 2017
Intermediate to advanced
310 pages
8h 5m
English
Packt Publishing
Content preview from Python Data Structures and Algorithms

Hashing and Symbol Tables

We have previously looked at lists, where items are stored in sequence and accessed by index number. Index numbers work well for computers. They are integers so they are fast and easy to manipulate. However, they don't always work so well for us. If we have an address book entry, for example, with index number 56, that number doesn't tell us much. There is nothing to link a particular contact with number 56. It just happens to be the next available position in the list.

In this chapter, we are going to look at a similar structure: a dictionary. A dictionary uses a keyword instead of an index number. So, if that contact was called James, we would probably use the keyword James to locate the contact. That is, instead ...

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 in Python

Data Structures and Algorithms in Python

Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser
Hands-On Data Structures and Algorithms with Python - Second Edition

Hands-On Data Structures and Algorithms with Python - Second Edition

Dr. Basant Agarwal, Benjamin Baka, David Julian
Data Structures & Algorithms in Python

Data Structures & Algorithms in Python

John Canning, Alan Broder, Robert Lafore

Publisher Resources

ISBN: 9781786467355Supplemental Content