Question: 4.Consider the following pseudo-code for the split(..) procedure to be called by the Q procedure: (Some people couldn't do this well. So we do it
4.Consider the following pseudo-code for the split(..) procedure to be called by the Q procedure: (Some people couldn't do this well. So we do it again.) procedure split(x, lef t, right, i) choaio t odrde uharity kuet nighl r (the output integer i is the position of T in the output array: xlil L a random integer in (lef t, right); 3 (now the splitter is first in the subarray 5 1:= left; 6 forj lef t+1 to right do - T: 2 swap(x[lef t), xILD; begin 7 if xUl
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
