Sorting algorithms Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Define bubble sort

A

compare elements with each other

like rising bubble

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

best case of bubble sort

A

O(n)

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

worst case of bubble sort

A

O(n^2)

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

average case of bubble sort

A

O(n^2)

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

Define merge sort

A

use midpoints

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

time complexity of merge sort

A

O(nlogn)

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