Educator
KS3 Computer Science

Algorithms

73 questions7 subtopics
Practise all 73 questions free →

What's covered

Flowcharts — Shapes and Meaning11
Pseudocode Basics11
Trace Tables11
Binary Search10
Bubble Sort10
Comparing Algorithm Efficiency10
Linear Search10

Key facts

1

Binary search starts by checking the middle item of the list.

2

Bubble sort works on a list of any size.

3

A sorted phone book is the classic case where binary search beats linear by a large margin.

4

Arrows (flowlines) join the shapes and show the direction the algorithm moves through them.

5

Linear search finds the item fastest when the target is at (or near) the start of the list.

6

Common pseudocode forms for assigning a value are SET x TO 5 or x ← 5.

7

Trace a snippet by updating the variable column at each step: starting x = 0, after SET x TO x+5 then SET x TO x*2, x ends at 10.

8

On a large sorted list, binary search is much faster than linear search.

9

At each step bubble sort compares two adjacent items.

10

On large sorted data, binary search is much faster than linear search.

Sample questions

A taste of the 73 questions in this topic — answers marked. Sign up to practise the full set with spaced repetition.

1Binary Search

Which item does binary search look at first?

  • A random item
  • The first item
  • The last item
  • The middle item
2Bubble Sort

How does bubble sort sort a list?

  • Finds the smallest item and moves it first
  • Inserts each item into its correct position
  • Splits the list in half each pass
  • Swaps neighbouring pairs repeatedly
3Comparing Algorithm Efficiency

Why compare two algorithms solving the same problem?

  • One may be more efficient
  • To check they produce the same code
  • To decide which programmer wrote better comments
  • To find which one uses more variables
4Flowcharts — Shapes and Meaning

Which shape represents a decision in a flowchart?

  • Diamond shape
  • Oval shape
  • Parallelogram shape
  • Rectangle shape
5Linear Search

How does a linear search work?

  • Checks each item one by one until the target is found
  • Hashes the target value to compute the index of the item directly
  • Repeatedly halves the list, checking only the middle item each time
  • Sorts the list first, then jumps to the position where the target should be
6Pseudocode Basics

Why use pseudocode?

  • Convert binary to decimal numbers
  • Plan an algorithm in plain language
  • Run the algorithm on the CPU directly
  • Send the algorithm over the network

Try it for four weeks. Free.

One school. Unlimited classes. No card limit. No teacher limit. If your students aren't practising daily by the end of the trial, you owe us nothing.

More KS3 Computer Science topics