Sorting Flashcards
1
Q
Time complexity of insertion sort
A
O(n^2), unless array already nearly sorted, then O(n)
2
Q
Time complexity of merge sort
A
O(nlogn)
3
Q
Time complexity of quick sort
A
O(nlogn) best case, worst case O(n^2)
4
Q
Time complexity of bucket sort
A
O(n)