Probability
Shuffle Card
void shuffleCard(int[] cards, int n){
for(int i=0; i<cards.length; i++){
int j=rand.nextInt(i, n);
swap(cards[i], cards[j]);
}
}Select a random number from stream with equal probability
Last updated