Question: 4. Consider the following pseudo-code for the split) procedure to be called by the QuickSort procedure: (Some people couldn't do this well. So we do

 4. Consider the following pseudo-code for the split) procedure to be

4. Consider the following pseudo-code for the split) procedure to be called by the QuickSort procedure: (Some people couldn't do this well. So we do it again.) procedure split, left, right, i) chooses at random an entry of the suburray (left, right and splits the suburray around the output integer i is the position of T in the output aray: - T: 1 L= a random integer in [left, right); swap(xleft), [L]: now the splitter is first in the subarray! T:=x[left): ir left: for j-left to right do begin ir xil then begin swappi). XUD end end swap(x[left). [1] 10 end{split Apply this procedure to the following array of integers: 69.8. 19, 51, 38, 25. 15. 2 3 4 5 6 7 8 9 Mentally execute this split procedure and show each step Suppose that it randomly generales 38 as the T for splitting in the procedure. The value of T splits this array into two parts Work through this array to get the final result. To make your answer clearly understandable, for each iteration show the whole array elements with where i, j, and Tare. You must show your reader that you understand how this split procedure works. You are NOT asked to sort this list. Instead you are asked to do split operating on this list of integers. (30 pts)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!