Back to Algorithms

Oak National Academy

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

Their topic:
Searching and sorting algorithms · Algorithms
For your topic:
Algorithms · Computer Science - 4CP0

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

Comparing searching algorithms

By the end: I can compare and contrast linear and binary search and trace the code for both searching algorithms.

Key learning points

  1. The searching algorithm you use will depend on the data and context you are using.
  2. Coding a binary search is more complex than a linear search.
  3. Tracing code for searching algorithms by completing a trace table can help you check how efficient the algorithm is.

Keywords

algorithm
a set of step-by-step instructions to solve a problem
trace table
a tool used to track the values of variables and the flow of execution in an algorithm or program, step by step

A common mistake

Mistake: A linear search algorithm and binary search algorithm are equally complex to write.

In fact: Binary search algorithms are more complex to write due to the different paths that the algorithm can take rather than stepping through the search data in order.

Check what you learned

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

What is a trace table used for?
Which searching algorithm is more complex to write?
Which of these is true about linear search?

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

Representing algorithms using flowcharts

By the end: I can create and represent an algorithm in a flowchart.

Key learning points

  1. Algorithms can be represented by flowcharts.
  2. Flowcharts use symbols to visually represent logic and data.
  3. Developing an algorithm's logic before coding makes problem solving easier.

Keywords

flowchart
a visual representation of an algorithm or program
symbol
a sign, shape or object that is used to represent something else
standardise
to make one thing the same as others of that type

A common mistake

Mistake: A flowchart should always be created before writing a computer program.

In fact: For simple programs, a flowchart may not be needed and could add to development time. Sometimes the program code itself might be clear enough without a flowchart.

Check what you learned

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

What is a flowchart?
What is the purpose of a flowchart?
Is it always necessary to create a flowchart before writing a computer program?
What is the main advantage of using flowcharts?
What does standardising flowchart symbols achieve?

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

Tracing algorithms

By the end: I can use trace tables to test the logic of an algorithm.

Key learning points

  1. Trace tables can be used to walkthrough and understand the logic of an algorithm.
  2. Trace tables can be used to help find logical errors in algorithms.

Keywords

trace table
a tool used to track the values of variables and the flow of execution in an algorithm or program, step by step
error
a mistake or unexpected behaviour in a program that prevents it from working correctly
modulo
an operation that gives you the remainder when one number is divided by another

A common mistake

Mistake: Using trace tables guarantees correct logic and code.

In fact: Trace tables can be subject to human error and can be impractical to use for complex algorithms.

Check what you learned

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

What is a trace table used for?
What is a common limitation of trace tables?
Why might trace tables be impractical for complex algorithms?

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.