It terminates because the number of gaps in Jk+1 > that in Jk. Since Jk contains f(k) gaps, the (f(k) + 1)-th insertion till the (2f(k) − 1)th insertion require only O(lgr + f(k)) operations. Then the (2f(k))-th insertion needs to perform more soft exchanges. The difference between the numbers of soft ex changes of the(if(k))-thand((i+1)f(k))-th insertions will increase by at most one(i.e.,the difference will be either zero or one). The difference decreases until the number of soft exchanges hit its bound r−k. When the bound of r−k soft exchanges is reached, we need the final hard exchange with worst case cost O(f(r)) operations.