3 ms·
Since they're evidently looking for pedantry, I present the following: >What factors influence which approach, between a linear scan and a sort+binary search,
by Groxx 14y ago
Since they're evidently looking for pedantry, I present the following:
>What factors influence which approach, between a linear scan and a sort+binary search, you should pick for an unsorted array?
"A" search implies once. Linear will always be better, since sorting implies visiting every element at least once, followed by a lookup, where linear is at most once. You can of course come up with data structures and contents where this will not be true, but if you're asking for all solutions to everything, the only possible answer would be "it depends".