On Sep 20, 10:25   쮮
> In my program I need to construct a priority queue that sorts ascending.
> The basic idea can be expressed in the following simple code that uses a
> Priority Queue concept.  𺯯
First, you may want to try the latest version of this class. I had it
in Facets for some time and it has been improved over the years.
Recently though, I made it it's own project. You should be able to get
it via 'gem install pqueue'.

> 1 require "pqueue"
> 2
> 3 pq=PQueue.new(proc{|x,y| x<y})

Is this supposed to be a proc and not a block? I think maybe you are
adding a proc to the queue (?). Try

   pq=PQueue.new{|x,y| x<y}

Though maybe this is a difference between old and new version.

> pq.push([2], [123456780], [123456708])

You need to bracket the whole thing.

  pq.push([2, 123456780, 123456708])

However arrays are not comparable, so as has been mentioned:

   pq=PQueue.new{|x,y| x[0]<y[0]}

HTH