Answer:
and ![[6,9,8,7]](https://tex.z-dn.net/?f=%5B6%2C9%2C8%2C7%5D)
Step-by-step explanation:
GIVEN: an array of ten integers
.
TO FIND: If we partition this array using Quick sort's partition function and using
for the pivot. List the elements of the resulting array after the partition finishes.
SOLUTION:
quick sort is a divide and conquer algorithm in which an array is partitioned into sub-arrays about an pivot element by checking whether elements are greater than pivot or and then sub arrays are sorted recursively.
Here
is the pivot element.
two arrays will be created, in first array element less than or equal to pivot element are stored in other elements greater than pivot element are stored.
Starting from first element of array
elements in first array will be ![=[4,0,3,1,2,5]](https://tex.z-dn.net/?f=%3D%5B4%2C0%2C3%2C1%2C2%2C5%5D)
elements in second array will be ![=[6,9,8,7]](https://tex.z-dn.net/?f=%3D%5B6%2C9%2C8%2C7%5D)
Hence the resulting array after the partition finishes are
and ![[6,9,8,7]](https://tex.z-dn.net/?f=%5B6%2C9%2C8%2C7%5D)
Check the picture below.
bear in mind that, a perpendicular line stemming from the right-angle like so, creates three similar triangles, a
large one, containing the other two smaller ones, a
medium and a
small.
so.. .we can just use the medium and small proportions.
solve for "x".
Answer:
6/9
Step-by-step explanation:
2/6 x 2 = 0.6... and the 6 keeps repeating. There is one repeating number, so your answer is 6/9.
Answer:
62,500
Step-by-step explanation:
2,500 times 9 + 40,000 because he didnt get the raise the first year he started so its only times 9