Content deleted Content added
→How is this stable sort example?: Static Stable Sorting Example |
→Static stable sorting example: add table with dividers |
||
Line 868:
|15 || Rockford || MN || 10 → 15|| Green Bay || WI || 8 → 14 → 15 || Milwaukee || WI
|}
===Static Stable sorting tables with dividers===
{| class="wikitable"
|+ {{nowrap|Unsorted table→Sorted by State Code→ Stable Sort by State,
then City}}
! Row !! scope="col" |'''City'''!! {{vert header|stp=1|'''State Code'''}} !! style="background: blue;" | !! Old<br>→<br>New<br>Row !! '''City'''!! {{vert header|stp=1|'''State Code'''}} !! style="background: blue;" | !! Original<br>→<br>Initial Sorting<br>→<br>Following<br>stable sort!! '''City'''!! {{vert header|stp=1|'''State Code'''}}
|-
|1 || Chicago || IL || style="background: blue;" | || 13 → 1||{{font color|red|Rockford}} || {{font color|red|IA}} || style="background: blue;" | || 13 → 1 → 1 ||{{font color|red|Rockford}} || {{font color|red|IA}}
|-
| {{ font color|blue|2}} || {{font color|blue|Rockford}} || {{font color|blue|IL}} || style="background: blue;" | || 2 → 2|| {{font color|blue|Rockford}} || {{font color|blue|IL}} || style="background: blue;" | || 4 → 5 → 2 || Champaign || IL
|-
|3 || Evanston || IL || style="background: blue;" | || 3 → 3|| Evanston || IL || style="background: blue;" | || 1 → 4 → 3 || Chicago || IL
|-
|4 || Champaign || IL || style="background: blue;" | || 1 → 4|| Chicago || IL || style="background: blue;" | || 3 → 3 → 4 || Evanston || IL
|-
|5 || Detroit || MI || style="background: blue;" | || 4 → 5|| Champaign || IL || style="background: blue;" | || 2 → 2 → 5 || {{font color|blue|Rockford}} || {{font color|blue|IL}}
|-
| {{font color|green|6}} || {{font color|green|New York}} || {{font color|green|NY}} || style="background: blue;" | || 12 → 6|| {{font color|violet|Rockford}} || {{font color|violet|MI}} || style="background: blue;" | || 5 → 7 → 6 || Detroit || MI
|-
|7 || Buffalo || NY || style="background: blue;" | || 5 → 7|| Detroit || MI || style="background: blue;" | || 12 → 6 → 7 || {{font color|violet|Rockford}} || {{font color|violet|MI}}
|-
|8 || Milwaukee || WI || style="background: blue;" | || 15 → 8|| Rockford || MN || style="background: blue;" | || 15 → 8 → 8 || Rockford || MN
|-
|9 || Albany || NY || style="background: blue;" | || 11 → 9|| {{font color|brown|Syracuse}} || {{font color|brown|NY}} || style="background: blue;" | || 9 → 12 → 9 || Albany || NY
|-
|10 || Green Bay || WI || style="background: blue;" | || 6 → 10|| {{font color|green|New York}} || {{font color|green|NY}} || style="background: blue;" | || 7 → 11 → 10 || Buffalo || NY
|-
| {{font color|brown|11}} || {{font color|brown|Syracuse}} || {{font color|brown|NY}} || style="background: blue;" | || 7 → 11|| Buffalo || NY || style="background: blue;" | || 6 → 10 → 11 || {{font color|green|New York}} || {{font color|green|NY}}
|-
| {{font color|violet|12}} || {{font color|violet|Rockford}} || {{font color|violet|MI}} || style="background: blue;" | || 9 → 12|| Albany || NY || style="background: blue;" | || 11 → 9 → 12 || {{font color|brown|Syracuse}} || {{font color|brown|NY}}
|-
| {{font color|red|13}} ||| {{font color|red|Rockford}} || {{font color|red|IA}} || style="background: blue;" | || 14 → 13|| Rockford || TN || style="background: blue;" | || 14 → 13 → 13 || Rockford || TN
|-
|14 || Rockford || TN || style="background: blue;" | || 8 → 14|| Milwaukee || WI || style="background: blue;" | || 10 → 15 → 14 || Green Bay || WI
|-
|15 || Rockford || MN || style="background: blue;" | || 10 → 15|| Green Bay || WI || style="background: blue;" | || 8 → 14 → 15 || Milwaukee || WI
|}
===Stable sorting example===
|