- What is hash?
- How do you make hash?
- What is Hash Table?
- What do you have to care when you create the Hash Table?
- What is good(bad) about Hash Table compare to array?
- when is better to use Hash Table over array
What are the time complixity of
- add(insert)
- get value by key
- find value
- remove key, value
- update value
Let's try to implement your own hash function. There is a good leedcode question here!
-
Rules
- Do not ever use pre existing hash table API
- If you use an array, try to fixed the size with 1000
Let's try to sovle some leetcode qusiton. These can be optimized by leveraging array and hash table data structure💪
- https://leetcode.com/problems/two-sum/
- https://leetcode.com/problems/first-unique-character-in-a-string/
- (optional) https://leetcode.com/problems/minimum-index-sum-of-two-lists/
https://leetcode.com/explore/learn/card/hash-table/
- What is Set?
- What is Set vs Hash Table?
- when is better to use Set over Hash Table