Implementation

How can I implement HashMap and TreeMap efficiently without using Collections/STL ?

1 Like

First of all, create a road map of what kind of structure/class you will be needed, what are members will be required and what functions you have to write for adding the key - value pair. Focus on the hash function that you are going to write to hash the keys to their corresponding values. Go through some standard docs regarding hash Tables/hash map and read about the terms like Load Factor, Rehashing (In case of dynamism). After that you will be able to decide by yourself that how you can make your hashmap efficient.

For your reference : https://medium.com/@aozturk/simple-hash-map-hash-table-implementation-in-c-931965904250

1 Like