Question: Describe an efficient way of putting a vector representing a deck of n cards into random order. You may use a function, randomInteger(n), which returns
Describe an efficient way of putting a vector representing a deck of n cards into random order. You may use a function, randomInteger(n), which returns a random number between 0 and n−1, inclusive. Your method should guarantee that every possible ordering is equally likely. What is the running time of your function?
Step by Step Solution
3.19 Rating (163 Votes )
There are 3 Steps involved in it
There are a few ways to approach this problem One way would be to iterate through the de... View full answer
Get step-by-step solutions from verified subject matter experts
