|
|
|
|
|
by mtdewcmu
4358 days ago
|
|
Shuffling can never prevent the worst case of any algorithm. "Worst case" means the worst out of all possible cases. Shuffling doesn't change the set of cases, and it doesn't change anything about any individual case. Probably what you meant was that shuffling makes the worst case very unlikely. On a practical level, if you have to shuffle the data before sorting to make your sort algorithm work better, you've most likely already blown any performance advantage. So you might as well choose a different sort algorithm. |
|