Sorting algorithms Flashcards
1
Q
Define bubble sort
A
compare elements with each other
like rising bubble
2
Q
best case of bubble sort
A
O(n)
3
Q
worst case of bubble sort
A
O(n^2)
4
Q
average case of bubble sort
A
O(n^2)
5
Q
Define merge sort
A
use midpoints
6
Q
time complexity of merge sort
A
O(nlogn)