AJAY KUMAR’s Post

📌 Day 19/100 – Design HashMap (LeetCode 706) 🔹 Problem: Design a basic HashMap data structure without using built-in hash table libraries. Implement methods to put, get, and remove key-value pairs efficiently. 🔹 Approach: Used a direct array-based mapping for keys up to 1,000,000. Initialized all values to -1 to mark absence of mappings. Implemented: put(key, value) → stores/updates the value. get(key) → returns the mapped value or -1 if absent. remove(key) → resets the key’s value to -1. 🔹 Key Learning: Reinforced understanding of hashing fundamentals and key-value mapping. Learned how to simulate data structures without built-in utilities. Understood the trade-off between memory and simplicity in design. A simple yet powerful reminder that sometimes brute structure works best! 💡 #100DaysOfCode #Day19 #LeetCode #Java #DSA #ProblemSolving #HashMap #CodingJourney

  • graphical user interface, text

To view or add a comment, sign in

Explore content categories