2.1 Bubble sort Flashcards
1
Q
What does a bubble sort do?
A
Sorts an unordered list of items
2
Q
How does a bubble sort work?
A
- It compares each item with the next one and swaps them if they are out of order
- The algorithm finishes when no more swaps need to be made
3
Q
What are some features of the bubble sort?
A
- This is the most inefficient of the sorting algorithms but is very easy to implement
- This makes it a popular choice for very small data sets