Kizspy | Question: 45
(Choose 1 answer)
You are developing a card game, and you need to shuffle a deck of cards thoroughly before each game.Explain how you would use Java collections to achieve an unbiased shuffle, and discuss the importance of randomness in shuffling.
A. Use Collections.shuffle() for a simple and unbiased shuffle.
B. Implement a custom Fisher-Yates shuffle algorithm for control.
C. Choose Random.nextInt() to generate random indices for shuffling.
D. Utilize Arrays.sort() with a random comparator for a randomized effect.
E. Implement a custom algorithm that swaps each card with a randomly chosen card.
F. Use Collections.reverse() for a reverse shuffling effect.