4 ms·
Maniagnosis – Quicksort
- coreyp_1 10y ago"First index plus last index, divided by two; yay integer division!" I don't know enough about Pony, but this approach has caused a bug in other languages, specifically when the "first index plus last index" causes an integer overflow. The better approach in these cases is to do "min + ((max - min) / 2)".