B
Brian Schröder
Hello Group,
I'm currently polishing my priority queue implementation, and I'm in
need for a name for some methods.
I have the following behaviour now
q =3D PriorityQueue.new
q["0"] =3D 0
q["1"] =3D 1
q["2"] =3D 2
q.delete_min #=3D> ["0", 0]
q.delete_min_return_key #=3D> "1"
q.delete_min_return_priority #=3D> 2
and wonder how I could call the last two methods. I want these,
because delete_min returns nil if the queue is empty, and I can't
index nil. So for some code these additional functions are quite
convenient.
thanks for the input,
Brian
I'm currently polishing my priority queue implementation, and I'm in
need for a name for some methods.
I have the following behaviour now
q =3D PriorityQueue.new
q["0"] =3D 0
q["1"] =3D 1
q["2"] =3D 2
q.delete_min #=3D> ["0", 0]
q.delete_min_return_key #=3D> "1"
q.delete_min_return_priority #=3D> 2
and wonder how I could call the last two methods. I want these,
because delete_min returns nil if the queue is empty, and I can't
index nil. So for some code these additional functions are quite
convenient.
thanks for the input,
Brian