-- Shell-sort array A in place -- by John C. Pezzullo, Ph.D.; NIH Perinatology Research Branch, Georgetown -- JohnP71@aol.com ra[i] = rand(1) dim[100] A:=ra: Sort: A:{0.003,0.026,0.042,0.044,0.047,0.065,0.068,0.068,0.069,0.069,...} Sort = N:=count(A), I:=N, ( I:=trunc(I/2), Span ) while I>1 Span = Int:=1, ( Int:=0, K:=0, ( K:=K+1, Swap ) while K <= N-I ) while Int=1 Swap = ( Save:=A[K], A[K]:=A[K+I], A[K+I]:=Save, Int:=1 ) when A[K]>A[K+I]