A note on heapq module

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Thu Jan 18 06:01:17 EST 2007


Neil Cerutti:
> One more idea, cribbed from the linked list thread elsewhere: it
> might be nice if your Heap could optionally use an underlying
> collections.deque instead of a list.
> I don't know how excellent Python's deque is, but it's possible a
> deque would provide a faster heap than a contiguous array. C++'s
> std::deque is the default implementation of C++'s
> std::priority_queue for that reason (unless I'm confused again).

If you have some minutes you can do few speed tests and show us the
code and the timing results...

Bye,
bearophile




More information about the Python-list mailing list