Data structures: organising information — Technology, 14–17 years
A computer needs more than values; it needs a useful way to arrange them. Data structures make searching, adding and changing information manageable.
Idea
A data structure is a chosen shape for information, such as a list, a queue or a tree. The shape affects what the computer can do quickly. A queue keeps the first arrival at the front, while a tree can split choices into branches.
Why
The problem is scale: finding one item in ten records is easy, but finding it in ten million is not. Early programs stored data simply, then programmers needed better arrangements to avoid checking everything. Choosing a structure is choosing where the work happens.
Worked example
A queue holds people waiting for three tickets. Ana joins first, then Ben, then Chiara. The program removes Ana and gives her a ticket, then Ben; if Diego joins, he goes behind Chiara. The order is preserved without repeatedly deciding who came first.
Trap
A reasonable mistake is to think that the most compact structure is always the best. A list may use little extra space, but inserting an item at its beginning can make many later items move. A tree or queue may use more memory yet make the common action faster.
Use
Queues manage print jobs, customer support and tasks waiting for a processor. Trees help file explorers show folders inside folders, while lists hold playlists or shopping items. The structure should match the actions people need most often.
Keep exploring
Other languages
Loading MyLeoNes™…