AQA GCSE Computer Science · 8525
Paper 1
Revise: Bubble SortComparing
5, 2therefore causes a swap to2, 5, whereas comparing5, 6leaves them unchanged. Equal values do not need to be swapped.
Loading…
GCSE Computer Science · key term
An exchange of the positions of two values.
Used by AQA
Paper 1
Revise: Bubble SortComparing
5, 2therefore causes a swap to2, 5, whereas comparing5, 6leaves them unchanged. Equal values do not need to be swapped.
Follow the order requested in the question: for ascending numerical order, swap when the left value is greater than the right value.
Use the updated list after each swap. Move along by one position so that consecutive comparisons overlap.
Show the stages requested, clearly labelling passes. Distinguish the pass that puts the list in order from a final no-swap pass that confirms it is sorted.
Create a free account to keep every note you open and track your progress.