Finding the new order of shuffled array

You can shuffle the indexes instead of the original array:

A = [11,13,25,10,9]
p = shuffle(eachindex(A)) # new order of elements
A_shuffled = A[p]

If you really want to find the index only after shuffling the original array, you can use indexin(A_shuffled, A).

3 Likes