Discover the process of how various programming languages implement an associative array using hash functions. Learn how a key and a hash function can be used to calculate a memory location for a value in a key-value pair.
- Now that you understand hashing, and what a hash is,…let's look at something called a hash table.…A hash table is a typical way…of implementing an associative array.…When a hash table's created internally,…it's really an array-based data structure…where we add extra functionality…to get us past the limitations of an array.…We use the term bucket to describe each entry…or place for a key-value pair to go in a hash table.…We'll never add just a key or just a value.…
We'll always add a pair.…Depending on the language,…we might use the word put, add or insert…to add a new key value pair.…When we add a new pair to the hash table,…a lot of stuff is going on behind the scenes.…The key will go through a hash function…and then an integer value will pop out.…Depending on the function,…it could be a rather large number,…so we can't just use it as an array index…in our implementation…but we can use it to calculate an array index.…
This requires some logic…and it's all done within the hash table implementation.…Diving in, our goal is to make…
- Data types: Booleans, numbers, strings, and more
- Multidimensional arrays
- Jagged arrays
- Search and sort arrays
- Linked lists
- Stacks and queues
- Hash functions and hash tables
- Trees and graphs
Skill Level Intermediate
Understand data structures1m 25s
1. Introduction to Data Structures
4. Stacks and Queues
5. Hash-Based Data Structures
6. Trees and Graphs
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.