sorting algorithm Flashcards
quicksort: best, avg, worst
best: nlogn
avg: nlogn
worst: n^2
mergesort: best, avg, worst
best: nlogn
avg: nlogn
worst: nlogn
heapsort: best, avg, worst
best: nlogn
avg: nlogn
worst: nlogn
insertion sort: best, avg, worst
best: n
avg: n^2
worst: n^2
selection: best, avg, worst
best: n^2
avg: n^2
worst: n^2
shell sort: best, avg, worst
best: nlogn
avg: n^(4/3)
worst: n^(3/2)
radix sort: best, avg, worst
best: n
avg: n
worst: n
quicksort: stable, fast, comparison
stable: no
fast: yes
comparison: yes
mergesort: stable, fast, comparison
stable: yes
fast: yes
comparison: yes
heapsort: stable, fast, comparison
stable: no
fast: yes
comparison: yes
insertion sort: stable, fast, comparison
stable: yes
fast: no
comparison: yes
selection sort: stable, fast, comparison
stable: no
fast: no
comparison: yes
shell sort: stable, fast, comparison
stable: no
fast: no
comparison: yes
radix sort: stable, fast, comparison
stable:
fast: yes
comparison: no
what makes a sorting algorithm stable?
can handle duplicates