Answer:

Hash tables (hash maps) - is amortized constant-time access data structures that map keys to values.

Binary Trees - is a tree data structure in which each node has at most two child nodes, usually distinguished as "left" and "right". Nodes with children are parent nodes, and child nodes may contain references to their parents. Main advantage O(nLog(n)) traversal time.

When to use a binary tree vs. a hash map (hash table):

1. When it is hard or impossible to define good hashing function
2. When we need to preserve relations between nodes(objects)
3. Arguably, for small projects to avoid code complexity





Answers and Comments


User Avatar
Written by CodeGuru


#3. Is definetly bad answer


Saved Stories

Sponsored Categories