| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
heapsort and verifies the result against list.sort().
|
|
|
|
|
| |
currently-smallest value, and add item, in one gulp. See the second
N-Best algorithm in the test suite for a natural use.
|
|
|
|
|
| |
in the test file. I have docs for heapq.heapify ready to check in, but
Jack appears to have left behind a stale lock in the Doc/lib directory.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added new heapify() function, which transforms an arbitrary list into a
heap in linear time; that's a fundamental tool for using heaps in real
life <wink>.
Added heapyify() test. Added a "less naive" N-best algorithm to the test
suite, and noted that this could actually go much faster (building on
heapify()) if we had max-heaps instead of min-heaps (the iterative method
is appropriate when all the data isn't known in advance, but when it is
known in advance the tradeoffs get murkier).
|
| |
|
|
|
|
| |
don't use division at all.
|
|
week.
|