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
2
Q
What is the final pass for a shuttle sort?
A
The pass that starts by comparing the last two numbers
3
Q
What is the maximum number if comparisons/swaps for a bubble/shuttle sort?
A
n(n-1)/ 2