next up previous
Next: Up: Previous:

Summary of Comparison Sorts



Sort Worst Case Average Case Best Case Comments
Insertion Sort \(\Theta(n^2)\) \(\Theta(n^2)\) \(\Theta(n)\)  
Merge Sort \(\Theta(n lg n)\) \(\Theta(n lg n)\) \(\Theta(n lg n)\) Requires Memory
Heapsort \(\Theta(n lg n)\) \(\Theta(n lg n)\) \(\Theta(n lg n)\) Large constants
Quicksort \(\Theta(n^2)\) \(\Theta(n lg n)\) \(\Theta(n lg n)\) Small constants

Compare sorting algorithms


next up previous
Next: Up: Previous: