News for hackers. Stuff that matters.
Re:Functional programming in Python by sureshv on Friday May 11, 2012 @08:10PM (#3962092)
Even if heaps were a first class data-structures wouldn't the choice between trees and lists exist in the underlying implementation? Ultimately you would have to allow for both or deal with the strengths and weaknesses of that implementation.
Re:Functional programming in Python by andreasvc on Sunday May 13, 2012 @05:21PM (#3968370)
As far as I know array-based heaps are most efficient with practical workloads (because it doesn't have the overhead & non-locality due to pointers for a tree structure). I don't think it's necessary to offer multiple implementations, just as there is only a single well tuned hash table in Python. What matters is that the functionality of an abstract data type is offered.