[Python-Dev] Priority queue (binary heap) python code

Alex Martelli aleax@aleax.it
Tue, 25 Jun 2002 09:30:43 +0200


On Tuesday 25 June 2002 06:09 am, Skip Montanaro wrote:
	...
> I don't know how efficient it would be, but I usually think that most
> applications have a small, fixed set of possible priorities, like ("low",
> "medium", "high") or ("info", "warning", "error", "fatal").  In this sort

Then you do "bin sorting", of course -- always worth considering
when you know the sort key can only take a small number of
different values (as is the more general "radix sorting" when you
have a few such keys, or a key that easily breaks down that way).

But it IS rather a special case, albeit an important one (and quite
possibly frequently occurring in some application areas).


Alex