class PQAdaptor

Public Class Methods

new() click to toggle source
# File benchmarks/sorted_set.rb, line 39
def initialize; @pq = PriorityQueue.new end

Public Instance Methods

empty?() click to toggle source
# File benchmarks/sorted_set.rb, line 43
def empty?
    @pq.empty?
end
next() click to toggle source
# File benchmarks/sorted_set.rb, line 46
def next
    min = @pq.min_key
    if min.next
        @pq.change_priority(min, min.current)
    else
        @pq.delete_min
    end
    min
end
push(stream) click to toggle source
# File benchmarks/sorted_set.rb, line 40
def push(stream)
    @pq.push(stream, stream.current)
end