Question: Read the above algorithm, and trace it out with sample numbers of your choice. Procedure Random permutation({x1, x2, ... ,Xn}) 1 Input : Objects {x1,x2,

Read the above algorithm, and trace it out with sample numbers of your choice.
Procedure Random permutation({x1, x2, ... ,Xn}) 1 Input : Objects {x1,x2, ...,Xn}; 2 Output: A random permutation II = {x6(1),X6(2), ... , Xo(n)}; 3 Initialize an array of size m(>n) as unmarked ; 4 for i = 1 to n do while A[j] is marked do | Generate a random number j Eu [1, m] ; A[j] = 1; mark A[j]; 9 Compress the marked locations in A[1,n] and Return A where (A[j]) = ; 5 6 7 8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
