Content deleted Content added
→top: in what language was this first written? |
→Pseudocode: Added the rebalancing operations and fixed some of the indexing |
||
Line 38:
'''procedure''' rebalance(A, begin, end) '''is'''
r ← end
w ← end
'''while''' r ≥ begin '''do'''
A[w+1] ← gap▼
A[w] ← A[r]
r ← r − 1
w ← w − 2
Line 50:
S ← new array of n gaps
'''for''' i ← 1 to floor(log2(n
'''for'''
ins ← binarysearch(A[j], S, 2^i)
insert A[j] at S[ins]
|