Implementation for array shuffling (Knuth algorithm)