Sorting Algorithms and Graph Theory Flashcards

1
Q

What is the stop condition for a bubble sort?

A

When a complete pass produces no swaps

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

What is the final pass for a shuttle sort?

A

The pass that starts by comparing the last two numbers

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

What is the maximum number if comparisons/swaps for a bubble/shuttle sort?

A

n(n-1)/ 2

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