PRO192_-_FA_2024_-_Block_5_-_FE_3237.webp
plum_blossom1

PRO192_-_FA_2024_-_Block_5_-_FE_3237.webp

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.

Thông tin

Category
PRO192
Thêm bởi
plum_blossom1
Ngày thêm
Lượt xem
3,058
Lượt bình luận
7
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom