Skip to content

Introduction to Data Structures

Beginning of the lesson

Introduction to Data Structures

Grouping many values together, so a program can handle collections of data

Big Idea: Sometimes one box for one value is not enough. When we have many things that belong together — like a whole shopping list or every score in a game — we can put them all inside one named group called a list. A way of organising data like this is called a data structure.
By the end you will be able to:
  • say what a data structure is in simple words,
  • explain how a list (also called an array) groups many values,
  • use the words item, position, and length to talk about a list.

1. One value is not always enough

Imagine a program that remembers your friend's name. It can keep one value in one labelled box, like friend = "Sara". That is fine for one thing.

But what if you have thirty friends? Making thirty separate boxes — friend1, friend2, friend3, all the way to friend30 — would be slow, messy, and easy to get wrong. There must be a tidier way to keep many values that belong together. There is: we group them.

When many values belong together, do not give each one its own box. Put them in a group.

2. What is a data structure?

A data structure is a way of organising data so a program can keep it tidy and find it easily. Just like a pencil case keeps your pens together, or a bookshelf keeps your books in order, a data structure keeps values together in a helpful shape.

The simplest and most useful data structure of all is the list. Many programming languages also call a list an array. A list holds many values in a row, one after another, all under a single name.

Continue this lesson on YourAIZone

The full lesson has the complete explanation, worked examples, common mistakes, tests with instant checking and an AI tutor. Start right away as a guest, or create an account to keep your progress.

In the full lesson

  • The complete explanation
  • Worked examples
  • Common mistakes and how to avoid them
  • Test questions: 15
  • AI tutor that answers questions about the topic
  • Progress tracking for students, parents and teachers