The Mudcat Café TM
Thread #137132 Message #3135115
Posted By: Mr Red
14-Apr-11 - 11:11 AM
Thread Name: Hungarian dance and shellsort
Subject: RE: Hungarian dance and shellsort
FWIW
a bubble sort is where the adjacent items are swapped if one is higher than the other*.
the decision is made progressively from the top to the bottom and then iterates until all are in order.
the highest bubbles to one end and the lowest to the other. Each iteration can be one item shorter because the highest* will bubble to the very end.
*depends on the decision "higher/lower" and the direction of progression.
Campanonolgist might see similarities in change ringing.
Use this method to speed the sorting when displaying all towns on this web page.