|
|
|
|
|
by smiths1999
2081 days ago
|
|
They are probably thinking of simply going through the list and tracking the top 3. This gives you linear time but as you noted you can go faster with quickselect (edit: I originally mistakenly wrote selection sort despite thinking of quickselect), giving you linear time (edit: I original said logarithmic time, which is obviously wrong). I suppose it is besides the point, but you shouldn't be reaching for a specific algorithm but rather using your language's library sort algorithm. |
|