QuestionQ14

Data Science Concepts

Which of these data structures relies on a method that maps keys to values?

Explanation

A hash table (or hash map) stores data as key-value pairs and uses a hash function to compute an index (or hash code) from the key, which determines where the corresponding value is stored in an underlying array. This allows for efficient average-case constant-time O(1) lookup, insertion, and deletion based on the key. Trees organize data hierarchically through parent-child node relationships and are typically used for ordered traversal or search operations rather than direct key-to-value hashing. Graphs represent entities as nodes connected by edges to model relationships, not a key-value mapping mechanism.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!