I studied hash tables in C++ and learned that there are two types of representation of hash tables, one using a tree and another type using an array from a linked list.
Since the hash table provides me with the fastest addition and fastest access, as it requires only one step, except for some cases in which the hash result for more than one key equals one index in the array, then I search within the linked list.
My question is, how can access be represented in one step and addition in one step using a tree, knowing that the tree is non-linear and does not have an index, and searching in it requires a number of steps, and the only case in which one step is needed is when the value is the root.
Do I need more explanation for this?
I read a lot but I didn’t understand