Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Add key= argument to heapq.nsmallest() and heapq.nlargest(). | Raymond Hettinger | 2004-12-02 | 1 | -1/+29 |
| | |||||
* | Fix argument order in pure python version of nsmallest() and nlargest(). | Raymond Hettinger | 2004-11-29 | 1 | -2/+2 |
| | |||||
* | Fix erroneous docstring comment. | Raymond Hettinger | 2004-09-06 | 1 | -2/+3 |
| | |||||
* | Improve the documented advice on how to best use heapq.heapreplace(). | Raymond Hettinger | 2004-06-20 | 1 | -1/+3 |
| | |||||
* | Install C version of heapq.nsmallest(). | Raymond Hettinger | 2004-06-13 | 1 | -1/+1 |
| | |||||
* | Improve the memory performance and speed of heapq.nsmallest() by using | Raymond Hettinger | 2004-06-12 | 1 | -0/+23 |
| | | | | | an alternate algorithm when the number of selected items is small relative to the full iterable. | ||||
* | SF patch #969791: Add nlargest() and nsmallest() to heapq. | Raymond Hettinger | 2004-06-10 | 1 | -2/+34 |
| | |||||
* | * Restore the pure python version of heapq.py. | Raymond Hettinger | 2004-04-19 | 1 | -0/+261 |
| | | | | * Mark the C version as private and only use when available. | ||||
* | Convert heapq.py to a C implementation. | Raymond Hettinger | 2003-11-08 | 1 | -255/+0 |
| | |||||
* | Implement and apply PEP 322, reverse iteration | Raymond Hettinger | 2003-11-06 | 1 | -1/+1 |
| | |||||
* | Fix a bunch of typos in documentation, docstrings and comments. | Walter Dörwald | 2003-10-20 | 1 | -1/+1 |
| | | | | (From SF patch #810751) | ||||
* | Fix typo in comment. | Fred Drake | 2002-11-13 | 1 | -2/+2 |
| | |||||
* | Added __all__. | Raymond Hettinger | 2002-10-30 | 1 | -0/+2 |
| | |||||
* | Fixed misspelling in comment. | Tim Peters | 2002-08-11 | 1 | -1/+1 |
| | |||||
* | Whitespace normalization. | Tim Peters | 2002-08-08 | 1 | -1/+1 |
| | |||||
* | Simplify heapreplace() -- there's no need for an explicit test for | Guido van Rossum | 2002-08-07 | 1 | -7/+4 |
| | | | | empty heap, since heap[0] raises the appropriate IndexError already. | ||||
* | _siftup(): __le__ is now the only comparison operator used on array | Tim Peters | 2002-08-03 | 1 | -1/+1 |
| | | | | elements. | ||||
* | Added new heapreplace(heap, item) function, to pop (and return) the | Tim Peters | 2002-08-03 | 1 | -0/+18 |
| | | | | | currently-smallest value, and add item, in one gulp. See the second N-Best algorithm in the test suite for a natural use. | ||||
* | Large code rearrangement to use better algorithms, in the sense of needing | Tim Peters | 2002-08-03 | 1 | -39/+79 |
| | | | | | | | | | | | | substantially fewer array-element compares. This is best practice as of Kntuh Volume 3 Ed 2, and the code is actually simpler this way (although the key idea may be counter-intuitive at first glance! breaking out of a loop early loses when it costs more to try to get out early than getting out early saves). Also added a comment block explaining the difference and giving some real counts; demonstrating that heapify() is more efficient than repeated heappush(); and emphasizing the obvious point thatlist.sort() is more efficient if what you really want to do is sort. | ||||
* | Minor fiddling, including a simple class to implement a heap iterator | Tim Peters | 2002-08-03 | 1 | -5/+5 |
| | | | | | 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. | ||||
* | Augment credits. | Guido van Rossum | 2002-08-02 | 1 | -1/+1 |
| | |||||
* | Hmm! I thought I checked this in before! Oh well. | Tim Peters | 2002-08-02 | 1 | -9/+29 |
| | | | | | | | | | | | | 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). | ||||
* | Add a PEP-263-style encoding turd^H^H^H^Hdeclaration, because there's | Guido van Rossum | 2002-08-02 | 1 | -0/+2 |
| | | | | a c-cedilla in one of the docstrings. | ||||
* | heappop(): Added comments; simplified and sped the code. | Tim Peters | 2002-08-02 | 1 | -21/+19 |
| | |||||
* | heappop(): Use "while True" instead of "while 1". | Tim Peters | 2002-08-02 | 1 | -1/+1 |
| | |||||
* | Don't use true division where int division was intended. For that matter, | Tim Peters | 2002-08-02 | 1 | -1/+1 |
| | | | | don't use division at all. | ||||
* | Add Kevin O'Connor, author of the heapq code. | Guido van Rossum | 2002-08-02 | 1 | -0/+2 |
| | |||||
* | Adding the heap queue algorithm, per discussion in python-dev last | Guido van Rossum | 2002-08-02 | 1 | -0/+176 |
week. |