Free taster
5 of 6 sections open
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
This topic in real past papers
Every real exam question we've found on bubble sort, with a full worked answer.