Back to Data Structures

Oak National Academy

Lessons written by expert teachers in England, each with slides, a video and quizzes.

Their topic:
Programming: strings and lists · Algorithms · Programming: dictionaries and data files
For your topic:
Data Structures · Computer Science - 9210

Use these lessons alongside our lesson note, which covers your syllabus in full.

What this covers in your syllabus

3 lessons from Oak National Academy

Lesson 1 of 3 · GCSE level, ages 14 to 16

Arrays and lists

By the end: I can describe the differences between lists and arrays and use a list in a program.

Key learning points

  1. Data structures are used to store data in an organised and accessible way.
  2. Data structures can be static or dynamic.
  3. Static data structures reserve memory locations for a set amount of data. Their size cannot change.
  4. Dynamic data structures are more flexible. The memory capacity is not fixed.

Keywords

static
a data structure that has a fixed size in memory
dynamic
a data structure that can grow or shrink to accommodate items
array
a static data structure that contains items of the same data type
list
a dynamic data structure that can contain items of different data types

A common mistake

Mistake: Arrays and lists behave in the same way.

In fact: An array has a predefined fixed size. A list can vary in size throughout program execution.

Check what you learned

From Oak National Academy's exit quiz. Choose every answer that is right.

Which of the following is true about arrays?
What is the correct way to create a list in Python?
Which of the following methods allows you to pick a random planet from the list planets?

A computing lesson by Oak National Academy licensed under the Open Government Licence (OGL) v3.0. Read the licence

Lesson 2 of 3 · GCSE level, ages 14 to 16

Data structures

By the end: I can describe and compare data structures.

Key learning points

  1. Data structures are used to help store, organise and manipulate data to solve problems efficiently.
  2. Arrays are static data structures that can store data of a single type in indexed elements.
  3. Lists are dynamic data structures that can store data of different types in indexed elements.
  4. The choice of data structure depends on the specific needs of the algorithm or problem.

Keywords

data structure
a way of organising and storing data in a computer
composite
something made of various parts or elements
dynamic data structure
a data structure where the size and memory allocation can change as a program runs
static data structure
a data structure with a fixed size and memory allocation that is set before a program runs

A common mistake

Mistake: Arrays are always the best choice for storing and accessing collections of data.

In fact: While arrays offer efficient direct access to elements using their index, they have limitations, such as fixed size and potential inefficiency in terms of unused elements.

Check what you learned

From Oak National Academy's exit quiz. Choose every answer that is right.

What is a data structure?
What is a static data structure?
What is a dynamic data structure?
Which of the following is an example of a static data structure?

A computing lesson by Oak National Academy licensed under the Open Government Licence (OGL) v3.0. Read the licence

Lesson 3 of 3 · GCSE level, ages 14 to 16

Records and dictionaries

By the end: I can create a record using a dictionary in Python.

Key learning points

  1. Data structures are used to store data in an organised and accessible way.
  2. A record is an example of a data structure.
  3. A record allows you to store a collection of attributes for a single entity.
  4. Python does not have a native data structure for a record.
  5. Instead, you can use a different data structure called a dictionary to represent a record.

Keywords

record
a collection of attributes for a single entity
entity
an entity is a single object, place, person or thing
attribute
properties or characteristics of an entity
dictionary
a data structure that involves creating data pairings that can be located using a key
key
used to identify each attribute held in the dictionary

A common mistake

Mistake: There is no way to store multiple records in one data structure in Python.

In fact: If you want to use multiple records in a database, then you can add multiple dictionaries to a list.

Check what you learned

From Oak National Academy's exit quiz. Choose every answer that is right.

What is a record in programming?
What is an attribute in a record?
What will be the output of the following code? ```player = { "username" : "rockstar", "password" : "6goatsEating", "score" : 5328 } print(player["username"])```
How is a record typically represented in Python?
How can you modify a value in a dictionary?

A computing lesson by Oak National Academy licensed under the Open Government Licence (OGL) v3.0. Read the licence

The wording comes from each publisher. The layout and the links to your syllabus are ours.