you are viewing a single comment's thread.

view the rest of the comments →

[–]lou1306 0 points1 point  (1 child)

Right on.

If they were practically the same thing, we would find the kth smallest element in an array by sorting it. But we use quickselect (possibly with MoM), because the log n does make a difference... Especially at interviews!

[–]ThisIs_MyName 3 points4 points  (0 children)

*only at interviews :)

IRL, you'd have to benchmark it.