If there is a for loop like
for ( int i = 0; i <= 10; i++ )
{
//block of code
}
What I want to achieve is, after first iteration i value need not to be 1, it can be anything from 1 to 10, i should not be 0 again and similarly for other iterations.
Simple algorithm:
In Java:
outputs:
EDIT
Now that I reread it, you could also simply shuffle the initial collection and loop: