|
|
|
|
|
by dataflow
1326 days ago
|
|
> No, wait. The QuickSort from the article is O(n²), What article are you referring to? This article is about binary search and mergesort, not quicksort? And which quicksort has O(n^2) typical behavior? That's the worst-case behavior you normally only get on adversarial inputs, not the typical one. (And standard libraries have workaround for that anyway.) |
|
I still think that it's normal for programs to behave weird when the input parameters are getting close to INT_MAX. Sometimes it's unavoidable. And if it's not specified in the function docs, you should go and check the implementation as a programmer. For binary search it is avoidable, so the criticism of the linked implementation is fair.