Read 30 ~ Hash Tables
By Abdallah obaid
NAME | URL |
---|---|
Home | Home. |
Prep | Prep: Engineering Topics. |
Read 01 | Node Ecosystem, TDD, CI/CD. |
Read 02 | Classes, Inheritance, Functional. |
Read 03 | Data Modeling & NoSQL Databases. |
Read 04 | Advanced Mongo/Mongoose. |
Read 05 | Linked Lists. |
Read 06 | HTTP and REST. |
Read 07 | Express. |
Read 08 | Express Routing & Connected API. |
Read 09 | API Server. |
Read 10 | Stacks and Queues. |
Read 11 | Authentication. |
Read 12 | OAuth. |
Read 13 | Bearer Authorization. |
Read 14 | Access Control (ACL). |
Read 15 | Trees. |
Read 16 | Event Driven Applications. |
Read 17 | TCP Servers. |
Read 18 | Socket.io. |
Read 19 | Message Queues. |
Read 26 | Component Based UI. |
Read 27 | React Testing and Deployment. |
Read 28 | Props and State. |
Read 29 | Component Composition. |
Read 30 | Hash Tables. |
Hash Tables
## Hash Tables:
- We use Hash Tables to: Hold unique values- Dictionary- Library.
- Hash Table is a data structure which stores data in an associative manner. In a hash table, data is stored in an array format, where each data value has its own unique index value. Access of data becomes very fast if we know the index of the desired data.
- Hash Tables is quickly why to retrieve the stored value depends on the key(index).
- Hash A hash is the ability to encode the key that will eventually map to a specific location in the data structure that we can look at directly to retrieve the value.its also the result of some algorithm taking an incoming string and converting it into a value that could be used for either security or some other purpose. In the case of a hashtable, it is used to determine the index of the array.
- Buckets A bucket is what is contained in each index of the array of the hashtable. Each index is a bucket. An index could potentially contain multiple key/value pairs if a collision occurs.
- Collisions A collision is what happens when more than one key gets hashed to the same location of the hashtable.
- In Hash Table we can do a lookup in an O(1) time complexity. This is ideal when quick lookups are required.