I have a confusion:
I read in many posts that Hash-maps are implemented as binary search trees, which makes the logarithmic complexity difficult for various operations.
Hashtables , on the other hand, provide a constant sampling of time.
But, as I read in this one , no difference was provided in terms of the complexity of searching / searching for elements in two data structures.
So here is my question -
Since hashtables guarantee constant search complexity, their implementation must be different from the implementation of hash maps. So, why does anyone ever use hash maps if they do not provide a constant time search. Also, why are they primarily implemented as binary search trees?
I know that hash cards store keys in sorted form and provide iteration through the map. But the same could also be included in the hash table.
source share