On Wed, Apr 12, 2017 at 4:44 PM, Ian Kelly <ian.g.ke...@gmail.com> wrote:
> On Wed, Apr 12, 2017 at 4:15 PM, Erik <pyt...@lucidity.plus.com> wrote:
>>     while len(items) > 1:
>>         items.sort(key=lambda item: item[0])
>
> This might be okay since Timsort on an already-sorted list should be
> O(n). But there's not really any need to keep them sorted and I would
> just use "lowest = min(items, key=itemgetter(0))".

Actually, you should consider using a heap.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to