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

Matthias Urlichs smurf@noris.de
Sun, 21 Jul 2002 10:29:30 +0200


Oren Tirosh <oren-py-d@hishome.net>:
>  When I want to sort a list I just use .sort(). I don't care which algorithm
>  is used.

The point in this discussion, though, is that frequently you don't 
need a sorted list. You just need a list which yields all elements in 
order when you pop them.

Heaps are a nice low-overhead implementation of that idea, and 
therefore should be in the standard library.
-- 
Matthias Urlichs