Content deleted Content added
Line 36:
'''procedure''' rebalance(A, begin, end) '''is'''
r ← end
w ← end
'''while''' r ≥ begin '''do'''
A[w+1] ← gap
A[w] ← A[r]
r ← r
w ← w
'''procedure''' sort(A) '''is'''
n ← length(A)
S ← new array of n gaps
'''for''' i ← 1 to floor(log2(n) + 1) '''do'''
'''for''' j ← 2^i to 2^(i + 1) '''do'''
ins ← binarysearch(A[j], S, 2^(i
insert A[j] at S[ins]
|