Merging multiple sorted sequences.

Erik python at lucidity.plus.com
Thu Apr 13 05:30:14 EDT 2017


On 13/04/17 07:30, Peter Otten wrote:
> Verdict: not greedy ;)

Great (as I mentioned I did look at the code VERY quickly whilst VERY 
tired and at first glance missed that it's doing almost exactly what my 
code is doing except using the heapq to manage tracking the smallest 
value rather than sorting or scanning a flat list all the time).

Thanks for the clear demonstration - it looks like that's exactly what I 
need then (as others have also pointed out, too).

E.



More information about the Python-list mailing list