On Sep 20, 10:25=A0pm, Mason Kelsey <masonkel... / gmail.com> wrote:
> 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. =A0See:http://www.math.kobe-u.ac.jp/~kodama/tips-=
ruby-pqueue.html

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 =A0 require "pqueue"
> 2
> 3 =A0 pq=3DPQueue.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=3DPQueue.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=3DPQueue.new{|x,y| x[0]<y[0]}

HTH