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 -- http://mail.python.org/mailman/listinfo/python-list