1.2.1

Algorithms

Test yourself

Algorithms

An algorithm is the steps and rules that are followed when completing a process. The main actions in an algorithm are sequence, selection and repetition.

Illustrative background for SequenceIllustrative background for Sequence ?? "content

Sequence

  • The sequence of an algorithm is the order of the steps that make up the algorithm.
    • E.g. the toppings cannot be put on the cakes until they are cooked.
Illustrative background for SelectionIllustrative background for Selection ?? "content

Selection

  • Selection is a yes or no choice.
  • A yes or no choice can be thought of as an ‘if ... then ’ instruction.
  • E.g. should the cakes be taken out of the oven?
    • If an inserted knife comes out clean, then yes.
    • If an inserted knife comes out dirty, then no.
Illustrative background for RepetitionIllustrative background for Repetition ?? "content

Repetition

  • Repetition means doing the same step over again.
  • The step can be repeated with different variables (something that can change).
    • The toppings must be placed on the cakes.
    • The step is repeated for each cake (repetition) but the type of topping can change each time (variable).
Illustrative background for Repeat until...Illustrative background for Repeat until... ?? "content

Repeat until...

  • Sometimes a step can be repeated until something happens.
  • Then we can move to the next step.
  • A step is repeated until something happens can be thought of as a ‘repeat until…’ instruction
    • Put cake batter in each paper case.
    • Repeat until all the cases are filled
    • Then stop and go to the next step.

Jump to other topics

1Computational Thinking & Algorithms

2Programming

3Hardware & Software

4Data

5The Internet

6Online Safety & Security

Go student ad image

Unlock your full potential with GoStudent tutoring

  • Affordable 1:1 tutoring from the comfort of your home

  • Tutors are matched to your specific learning needs

  • 30+ school subjects covered

Book a free trial lesson