FREE LESSON · Mathematics & logic · 1 OF 4

Data Representation in Computer Science

The map is not the territory — Representation is the first engineering decision

A computer only sees the model you give it.

Real situations contain unlimited detail. A representation deliberately preserves some distinctions and discards others: a graph keeps entities and relationships; a bitmap keeps sampled colour; an account balance keeps an agreed unit and precision. An algorithm is only meaningful after those states and operations are defined.

A representation is a contract about what may be noticed, changed, and ignored.

One queue, three different models

A support queue can be a FIFO list when fairness means arrival order, a priority heap when severity dominates, or several queues when service classes have separate promises. The customers did not change. The representation changed which operation became cheap and which policy became natural.

Before choosing a structure, write the operations and the promise each operation must preserve.
Open this lesson in the interactive course →