News for hackers. Stuff that matters.
Re:Why don't they just..? by eru on Monday August 20, 2012 @10:37AM (#4407792)
> The only way to prevent this, randomly sorting every unsorted collection you export, isn't feasible to reliably maintain.

It's feasible to maintain. But people might rely on it, too. As a random example (and easily avoidable example), quicksort works with random input, but 'breaks' for pre-sorted input.

Re:Why don't they just..? by dpark on Monday August 20, 2012 @12:07PM (#4408228)
That depends on the pivot chosen. If your quicksort implementation actually hits n^2 behavior with sorted input, it's probably not the best implementation.

Any implementation can hit n^2 with random input. It's just highly unlikely.

Re:Why don't they just..? by eru on Tuesday August 21, 2012 @04:21AM (#4411683)
Yes, I know. That's what the "easily avoidable" was for. I couldn't think of a better example in a few minutes, but if something can go wrong, I am sure it will eventually go wrong.