h ec G T N L and cs ust hk g ON Science golin a of c aterlo o y W ersit rudolf f G EG A aterlo o uwaterloo tD W g Email of Kong Univ y imunro Hong ersit Kong The Univ y HKUST gran Hong eddemaine Science Science wlo on Ko tmchan y HKUST Theoretical Computer Science Center Research Report HKUST-TCSC-2001-03 Ba rt of Computer Computer the t and tain biedl of of Most f para ater of rt t t h h W y as partially supp orted b ts increas a Shellso re n main rt tests an basic arra whic whic log Email her w Clear notion Munro rt elemen they n on Bubbleso only few Demaine n Departmen Departmen page O y h a en the p erforms from one p oin Guess So t of view Ian ev D Canada nology R Fleisc unsorted on rt e g for sorts whic J time algorithms Dumb So n that But rt rt O Erik cells sortedness sorts term based y h Shellso y time initially merging sorting of be t far arra an to hange b etter Golin and us to approac rom another p oin Insertion So a exc in F arian in place v Chan of is runs in exp ected h reasonable this in t rt Not So Dumb So y rt The y in to cycles or in time made th Abstract searc un Sort y arian greedy selection n v F n Mordecai ork ys of increasingly greater length as the pro cess Shellso O w p ossible pairs of ebruary arra densit Timoth F Dumb So algorithms tend n to binary taining an all study ts of y progress the time y e log in place b exceptions w hanging of or her main n the greater t an sorting y exc happ en ersion of O b rt pap er Biedl ts on notable cycles Fleisc insertions erhaps t cells also sorts in segmen this un So P are tains sorted subarra F arian op erate In v ed sorted segmen n insertion tro duction rt v ues longer p eated randomized v And sorts in time adjacen rep eatedly compares in miraculously Rudolf Therese In tin terlea con view main metho ds in ingly Quickso strong in Comparison based digms
is delightfully chaotic Atany stage one is presented with a subregion which
one hop es is reasonably close to sorted order and then is to complete the
task by using linear Insertion Sort Magically itworks pretty well
Our starting point is the notion of sorting by rep eatedly moving values
from current to more likely lo cations by p erforming binary searches If an
array were in sorted order except for the lo cation of one value then this
approach would minimize b oth the number of comparisons and the number
of moves necessary to complete the task The approachwould certainly place
the set maximum and minimum in their prop er sp ots and never movethem
again If the array is close to b eing in sorted order the pro cess will generally
make further progress Our question is whether the general approach of
binary insertion into an initially unordered array can be harnassed to yield
a viable sorting algorithm