Bubble Sort Flashcards
(2 cards)
1
Q
How does bubblesort work?
A
Makes comparisons and swaps between pairs of elements.
starts with the first element and compares with the second if the second is smaller then they swap
2
Q
Downsides of bubblesort
A
Will compare pairs that dont need to be compared
Fairly slow
time complexity of O(n^2).