Sorting Flashcards

1
Q

Time complexity of insertion sort

A

O(n^2), unless array already nearly sorted, then O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Time complexity of merge sort

A

O(nlogn)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Time complexity of quick sort

A

O(nlogn) best case, worst case O(n^2)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Time complexity of bucket sort

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly