Content deleted Content added
... previous statement was not true - what if you have an ordered list? python's timsort has an optimization for this. |
→Comparison of algorithms: - Fixed Width to 350 for Column "Other Notes" for viewing on smaller screens |
||
Line 50:
{|class="wikitable sortable"
!Name !! Average !! Worst !! Memory !! Stable !! Method !! width="350"|Other notes
|- align="center"
|[[Bubble sort]]
Line 58:
|style="background:#ddffdd"| Yes
|| Exchanging
|
|- align="center"
|[[Cocktail sort]]
Line 66:
|style="background:#ddffdd"| Yes
|| Exchanging
|
|- align="center"
|[[Comb sort]]
Line 74:
|style="background:#ffdddd"| No
|| Exchanging
|
|- align="center"
|[[Gnome sort]]
Line 82:
|style="background:#ddffdd"| Yes
|| Exchanging
|
|- align="center"
|[[Selection sort]]
Line 90:
|style="background:#ffdddd"| No
|| Selection
|
|- align="center"
|[[Insertion sort]]
Line 98:
|style="background:#ddffdd"| Yes
|| Insertion
|
|- align="center"
|[[Shell sort]]
Line 106:
|style="background:#ffdddd"| No
|| Insertion
|
|- align="center"
|[[Binary tree sort]]
Line 114:
|style="background:#ddffdd"| Yes
|| Insertion
|
|- align="center"
|[[Library sort]]
Line 122:
|style="background:#ddffdd"| Yes
|| Insertion
|
|- align="center"
|[[Merge sort]]
Line 130:
|style="background:#ddffdd"| Yes
|| Merging
|
|- align="center"
|nowrap|[[In-place]] [[merge sort]]
Line 138:
|style="background:#ffdddd"| No
|| Merging
|
|- align="center"
|[[Heapsort]]
Line 146:
|style="background:#ffdddd"| No
|| Selection
|
|- align="center"
|[[Smoothsort]]
Line 154:
|style="background:#ffdddd"| No
|| Selection
|
|- align="center"
|[[Quicksort]]
Line 162:
|style="background:#ffdddd"| No
|| Partitioning
|
|- align="center"
|[[Introsort]]
Line 170:
|style="background:#ffdddd"| No
|| Hybrid
|
|- align="center"
|[[Patience sorting]]
Line 178:
|style="background:#ffdddd"| No
|| Insertion & Selection
|
|- align="center"
|[[Strand sort]]
Line 186:
|style="background:#ddffdd"| Yes
|| Selection
|
|- align="center"
|[[Tournament sort]]
Line 194:
|
|| Selection
|
|}
|