Message215848
It's not really relevant what a heapified list looks like (and there is no reason to guarantee a particular appearance, since it's an implementation detail that could change). It's supposed to function as a heap with the heap functions, that's all. The docs do give a guarantee that a sorted list is already "heapified", but that's a one way guarantee: All sorted lists are heaps, but not all heaps are sorted lists.
The docs also mention the big-O behavior of heapify; it's linear time, O(n), while good general purpose sorting algorithms are O(n log n). A linear algorithm cannot sort a general list. |
|
Date |
User |
Action |
Args |
2014-04-09 21:33:43 | josh.r | set | recipients:
+ josh.r, ezio.melotti, wchlm, Saimadhav.Heblikar |
2014-04-09 21:33:42 | josh.r | set | messageid: <1397079222.99.0.665884830367.issue21185@psf.upfronthosting.co.za> |
2014-04-09 21:33:42 | josh.r | link | issue21185 messages |
2014-04-09 21:33:42 | josh.r | create | |
|