vendredi 18 octobre 2019

How can I randomly iterate over each element of vector without repetition

I tried using rand() with srand() to generate random index numbers but i still get indices repeating is there any other way of iterating over all elements of a vector buy getting the indices randomly without affecting order of vector elements I cant random_shuffle() because random shuffle changes the order of my vector elements whose order is critical.

Aucun commentaire:

Enregistrer un commentaire