Question: you are given an array A which can store n integers. design an efficient algorithm that randomly selects 0 or 1 for each element A
you are given an array A which can store n integers. design an efficient algorithm that randomly selects 0 or 1 for each element A and then rearranges the array so that all the 0's appearbefore 1's. a will then be of the form A:=<0,..0,1,..1>. write pseudocde for the algorithm and provide tight lower and upper bound on the running time of your pseudocode
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
