Bubble Sort

Computer ScienceOCRGCSEUnit: 3.1 Fundamentals of Algorithms
Free taster
5 of 6 sections open
The basics

Reusable Code Blocks

Reusable Code Blocks

Imagine writing instructions for making tea. Instead of writing "boil water" every time, you could say "see 'boiling water' instructions on page 5". Subprograms (functions and procedures) work the same way - write code once, use it many times by "calling" it. Functions return a value (like a vending machine giving you a drink). Procedures just do something (like pressing a button that turns on a light).

Now try it yourself

Quiz · Question 1 of 16

Which of the following best describes bubble sort?

Tap an answer to check it

Revise every Computer Science topic, free during alpha

Bubble Sort is one of 60 topics on PrepWise — all aligned to your exam board.

Start revising free →