Hello community. The title is quite self explanatory. Suppose I have the vector:
I want to shuffle the elements of v such that there is no index repetition with previous order. For example, this is not good
because '3' falls in the same place as before. This is good:
I am performing the shuffling with:
Of course this is just an example, I will be working with quite large arrays, so jumping into for or while loops to check weather new permutation is ok or not (and make new permutation if so) is time consuming. Any ideas or suggestions will be much appreciated. Cheers.