4 ms·
“Hashtable: like an array but instead of an index you can set arbitrary keys for each value.” This sounds like a gross over simplification of what a Hashtable
by deckarep 8y ago
“Hashtable: like an array but instead of an index you can set arbitrary keys for each value.”
This sounds like a gross over simplification of what a Hashtable really is underneath the covers.
Any candidate that shows up with that definition better be ready to dive in on what it really is and when you’d want to use it.
- cup-of-tea 8y agoThat doesn't even describe a hash table, it describes an associative array, or map. A hash table as one way to implement that, the other main one being self-balancing binary trees.
- ummonk 8y agoOr more broadly, self-balancing trees (the best performing balanced tree, the B-tree, is not generally a binary tree). And then there is the skip list.
- cup-of-tea 8y agoYes, quite right. Is a B-tree worth it when the structure is fully in memory, though? I would say that when talking about maps people are thinking of in memory structures.
- ummonk 8y agoIt absolutely is! You get significantly better cache utilization with a B-tree.