Computer Science I / Basic Data Collections
Practice question · Multiple choice

A list stores elements by sequential position, whereas a dictionary associates values with unique keys. What design consequence follows from this difference when choosing how to represent entity data?

Hints
  1. How do you address an individual value when numeric position carries no meaning?
  2. Does a key provide identity, or does it enforce sequential ordering?
Show the answer

A. A dictionary requires meaningful identifiers rather than sequence

Why

Positional sequences rely on an item's place in line, whereas map-like structures depend entirely on distinct lookup labels. Dictionaries do not sort their entries numerically or alphabetically, nor do lists restrict repeated elements or permit arbitrary retrieval without an index.

Read the lesson: Basic Data Collections →

Practise Basic Data Collections

The app has 7 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Basic Data Collections