Question: ( 3 0 points ) Shuffling is a technique used to randomize the order of a deck of cards, but the same techniques can be

(30 points) Shuffling is a technique used to randomize the order of a deck of cards,
but the same techniques can be used to randomize the order of a list. Give pseudocode
for a list operation SHUFFLE that performs the following actions on the list:
The list L is divided into two lists L1 and L2.
The lists are merged by picking the first node of either L1 and L2 at random, and
appending that node to the end of a new list, then repeating with the new first
nodes of the two lists.
You can make the following assumptions:
The list is implemented using a doubly-linked list.
The argument passed in is the "cut point" of the list, that is the first node of L2.
You have access to a black-box function Random which outputs true and false
according to some probability distribution.
( 3 0 points ) Shuffling is a technique used to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!