Question: public void shuffle() -- This method will re-arrange the cards that are in the deck. The idea is that the deck will be divided into
public void shuffle() -- This method will re-arrange the cards that are in the deck. The idea is that the deck will be divided into two "packets" -- the top half and the bottom half. The new array of cards will consist of: the first card from the top packet, followed by the first card from the bottom packet, followed by the second card from the top packet, followed by the second card from the bottom packet, etc. Important: If there are an odd number of cards, the top packet should have one more card than the bottom packet. Remember that the top of the deck is considered to be the front of the array.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
