Question: ( 3 0 points ) Shuffling is a technique used to randomize the order of a deck of cards, but the same techniques can be
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 is divided into two lists and
The lists are merged by picking the first node of either and 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 doublylinked list.
The argument passed in is the "cut point" of the list, that is the first node of
You have access to a blackbox function Random which outputs true and false
according to some probability distribution.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
