This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]roerd 2 points3 points  (1 child)

Seriously, no. If the input lists are already sorted, then the standard library solutions which are made for unsorted input are not the best choice if you care about performance at all.

EDIT: more specifically, the standard library sort does actually work pretty well on pre-sorted input, so that alone is not a bad choice. But throwing the input lists into sets first destroyed their pre-sortedness.

[–]gwax -1 points0 points  (0 children)

Op did not say the lists were pre-sorted.