1.2.12
Bubble Sort
Test your knowledge with free interactive questions on Seneca — used by over 10 million students.
Bubble Sort
Bubble sort is a naive sorting algorithm.

The concept
- Imagine that you have a set of cards face up on the desk.
- If the first two cards are in the wrong order, you swap them.
- Then do the same for the second and third cards, and continue in this pattern until the end of the pack. This is known as a pass.
- The highest value will 'bubble' up to the top of the pack each pass.
- By repeating this enough times, the pack will get sorted.

In English
- Compare the first two items of the dataset:
- If they are in the wrong order, swap them.
- Continue for the rest of the cards in the deck.
- Repeat the whole process, until a pass with no swaps happens.

Pros and cons of bubble sort
- Pros:
- Easy to implement.
- Does not use much memory.
- Cons:
- Poor for efficiency.
1Computational Thinking & Algorithms
1.1Computational Thinking
1.2Algorithms
1.2.1Algorithms1.2.2Pseudocode1.2.3Flow Diagrams1.2.4Logical Reasoning & Debugging1.2.5Reading Algorithms1.2.6Correcting Algorithms1.2.7Complete the Algorithm1.2.8Search Algorithms1.2.9Linear Search1.2.10Binary Search1.2.11Sort Algorithms1.2.12Bubble Sort1.2.13Insertion Sort1.2.14End of Topic Test - Algorithms
2Programming
2.1Programming Fundamentals
2.1.1Variables & Constants2.1.2Comments2.1.3Input & Output2.1.4Arithmetic Operators2.1.5Relational Operators2.1.6Boolean Operators2.1.7Sequence2.1.8Selection2.1.9Iteration2.1.10Subroutines2.1.11Scope2.1.12Data Types2.1.13Casting2.1.14Arrays2.1.152D Arrays2.1.16Lists2.1.172D Lists2.1.18Strings2.1.19Syntax Errors2.1.20Logic Errors2.1.21Runtime Errors2.1.22End of Topic Test - Programming
2.2Designing Code
3Hardware & Software
3.1Hardware
3.2Software
4Data
5The Internet
6Online Safety & Security
6.1Protecting Yourself Online
Jump to other topics
1Computational Thinking & Algorithms
1.1Computational Thinking
1.2Algorithms
1.2.1Algorithms1.2.2Pseudocode1.2.3Flow Diagrams1.2.4Logical Reasoning & Debugging1.2.5Reading Algorithms1.2.6Correcting Algorithms1.2.7Complete the Algorithm1.2.8Search Algorithms1.2.9Linear Search1.2.10Binary Search1.2.11Sort Algorithms1.2.12Bubble Sort1.2.13Insertion Sort1.2.14End of Topic Test - Algorithms
2Programming
2.1Programming Fundamentals
2.1.1Variables & Constants2.1.2Comments2.1.3Input & Output2.1.4Arithmetic Operators2.1.5Relational Operators2.1.6Boolean Operators2.1.7Sequence2.1.8Selection2.1.9Iteration2.1.10Subroutines2.1.11Scope2.1.12Data Types2.1.13Casting2.1.14Arrays2.1.152D Arrays2.1.16Lists2.1.172D Lists2.1.18Strings2.1.19Syntax Errors2.1.20Logic Errors2.1.21Runtime Errors2.1.22End of Topic Test - Programming
2.2Designing Code
3Hardware & Software
3.1Hardware
3.2Software
4Data
5The Internet
6Online Safety & Security
6.1Protecting Yourself Online
Practice questions on Bubble Sort
Can you answer these? Test yourself with free interactive practice on Seneca — used by over 10 million students.
- 1Advantages of bubble sort:Fill in the list
- 2What is the main disadvantage of bubble sort?Multiple choice
- 3Bubble Sort in EnglishPut in order
Unlock your full potential with Seneca Premium
Unlimited access to 10,000+ open-ended exam questions
Mini-mock exams based on your study history
Unlock 800+ premium courses & e-books
