I have a range of numbers 1 to 100 which are indices to a list, I need to pick a list at random. If what i am looking for in the list is not found, I need to pick a next random integer within the range which gets me to the list and it should not be the one which was previously selected,, In there a way to do this efficiently in C. I could do it with shuffling an array of indices but I want to know if there is a better way.
To summarize, i need a very good random algorithm which returns an integer which i know is random and was never used before.
I do know about rand(), srand() and randomize(). I am not sure if these serve the purpose.