Knowledge Organiser: Bubble Sort

Part of Bubble Sort · Section 7 of 7

Topic SummaryUnit: 3.1 Fundamentals of AlgorithmsGCSE

Key Terms

  • Bubble sort: Compares neighbouring items and swaps them if they are in the wrong order
  • Pass: One full run through the list
  • Swap: Exchange the positions of two items
  • Swap flag: A True or False variable that records whether a pass made any swaps
  • In place: Sorts the list without needing a second list

Must-Know Facts

  • After pass one, the largest value is at the end of the list
  • A pass with no swaps shows the list is sorted
  • A list of n items needs at most n - 1 passes that make swaps
  • The first pass on 5 items makes 4 comparisons
  • Bubble sort is best for small lists and for learning how sorting works
  • It is a poor choice for very large lists

Key Concepts

  • Compare neighbours, swap if out of order, move along, repeat
  • Each pass puts one more value in its final place at the end
  • Swap flag: stop as soon as a pass makes no swaps
  • Repeated passes are needed because small values move left only one place per pass
  • In exams: show the list after each pass

Common Mistakes

  • Doing only one pass: One pass sorts the list only if it was already nearly in order
  • Comparing items that are not neighbours: Bubble sort always compares adjacent items
  • Not showing the list after each pass: Showing only the final list loses the method marks
  • Saying the smallest value is first after pass one: It is the largest value that reaches the end. Small values only move one place left per pass
  • Calling bubble sort the best sort: It is simple, but it makes many comparisons on large lists

This topic summary covers Knowledge Organiser: Bubble Sort within Bubble Sort for GCSE Computer Science. Revise Bubble Sort in 3.1 Fundamentals of Algorithms for GCSE Computer Science with 16 exam-style questions and 10 flashcards. This topic appears regularly enough that it should still be part of a steady revision cycle. It is section 7 of 7 in this topic. Use this topic summary to connect the idea to the wider topic before moving on to questions and flashcards.

Practice questions for Bubble Sort

Which of the following best describes bubble sort?

  • A. It selects the smallest element and moves it to the front each pass
  • B. It compares adjacent elements and swaps them if they are in the wrong order
  • C. It divides the list in half repeatedly until each half is sorted
  • D. It inserts each element into its correct position one at a time
1 markfoundation

Describe how bubble sort works. You should refer to what happens during each pass through the list. [3 marks]

3 marksstandard

Quick recall flashcards

How does bubble sort work?
Compare adjacent pairs, swap if wrong order, repeat passes
Why is it called bubble sort?
Largest values bubble up to the end like bubbles rising in water

16 questions on Bubble Sort: practise free

Instant marking, adaptive difficulty and spaced-repetition flashcards — all aligned to your exam board.

Start revising free →

PrepWise is a trading name of A3M Quality Solutions Limited, registered in England and Wales, company number 14959172. Registered office: 202 Stroud Road, Gloucester, GL1 5LA. ICO registration ZC267069.