class Concurrent::Collection::RubyNonConcurrentPriorityQueue

def swim(k)

Parameters:
  • k (Integer) -- the index at which to start the percolation
def swim(k)
  success = false
  while k > 1 && ! ordered?(k/2, k) do
    swap(k, k/2)
    k = k/2
    success = true
  end
  success
end