Explore the advantages and disadvantages of hash tables and associative arrays so you know when it is best to use this data structure over others. Learn the runtime complexity of each hash table operation in terms of Big O notation.
- So when should you use a hash-based data structure?…Data and hash maps is stored in such a way…that searching is much faster…than many other data structures.…However, hash maps do take up more space.…Insertion and deletion is also quick.…There's a little bit of processing involved for retrieval…and insertion, but it's the same amount of processing…every time, no matter how big the hash table is.…This means that lookup, insertion and deletion…all take O of one or constant time,…because its runtime is consistent across any input.…
The only reason this might differ is if you have collisions…and must handle them with separate chaining,…which create linked lists with additional values.…If that's the case, then these operations…may take up more time, and up to O of n…if all the values are stored in one bucket.…Now, if you have a custom object as a key,…you might need to provide your own hash…and equality functionality, as we talked about before.…But in a situation where you have a lot of key-value pairs…or volatile data, these beat arrays hands down.…
- 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.