Most efficient way to randomly “sort” (Shuffle) a list of integers in C#
A good linear-time shuffling algorithm is the Fisher-Yates shuffle. One problem you’ll find with your proposed algorithm is that as you near the end of the shuffle, your loop will spend a lot of time looking for randomly chosen elements that have not yet been swapped. This may take an indeterminate amount of time once … Read more