PRO192_-_FA_2024_-_FE_2969.webp
B

PRO192_-_FA_2024_-_FE_2969.webp

Kizspy | Question: 46 (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.

Thông tin

Category
PRO192
Thêm bởi
Bích Thủy
Ngày thêm
Lượt xem
4,192
Lượt bình luận
8
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom