HASHING | Hash Tables Explained + 5 LeetCode Problems in Python
Big O Zoo
0:00 / 0:00
HASHING | Hash Tables Explained + 5 LeetCode Problems in Python
6 просмотров · 7 дней назад
Big O Zoo
11 подписчиков
6 просмотров · 7 дней назад
How can a Python dict find anything in O(1), no matter how much data you have? 🐦 In this Big O Zoo episode, Percy the Pigeon runs the zoo's post office and shows you exactly how hashing works: hash functions, buckets, collisions, chaining vs open addressing, load factor & resizing, hash flooding attacks, and what can (and can't) be a dictionary key. Then we solve 5 classic hashing interview problems step by step in Python, including building our own hash map from scratch, plus a bonus.
🧩 Problems solved (Python)
1️⃣ Contains Duplicate (LeetCode 217): Seen set
2️⃣ Design HashMap (LeetCode 706): Build it yourself
3️⃣ Longest Consecutive Sequence (LeetCode 128): Set lookups
4️⃣ Top K Frequent Elements (LeetCode 347): Count + bucket sort
5️⃣ Subarray Sum Equals K (LeetCode 560): Prefix sum + hash map
⭐ Bonus: Isomorphic Strings (LeetCode 205)
📝 Homework: 383 · 290 · 36 · 146
👉 Watch the Arrays & Strings episodes too: Two Sum and Group Anagrams were hashing all along!
👉 Next enclosure: Linked Lists.
#DSA #Hashing #HashTable #LeetCode #CodingInterview #Python #BigO #DataStructures