Are we aiming for a solution that makes less than 2(n-1) comparisons in the average case? Or less than that even in the worst case?
Also, should the solution be a general one that doesn’t depend on the contents of the collection being integer? Or can it be specific to integers?
Thanks!