Content deleted Content added
Tags: Mobile edit Mobile web edit |
|||
Line 51:
===Pseudocode===
'''
r ← end
w ← end * 2
'''while''' r
A[w+1] ← gap
A[w] ← A[r]
Line 60:
w ← w - 2
'''
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-1))
insert A[j] at S[ins]
|