Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (anonymous):

easy partition q: given the 10 integers: if 5 is the pivot , draw the resulting array after the partition finsihes: 5 3 8 9 1 7 0 2 6 4

OpenStudy (anonymous):

i got: 3 1 0 2 4 5 8 6 7 9?

OpenStudy (anonymous):

I belive the result in quick sort, you got it right

OpenStudy (shadowfiend):

It kind of depends on how you assemble it, but typically the right side of the pivot will have its numbers in the same order as the original array, as well. So 5 8 9 7 6 would be more likely. Still, yours is equally correct, since ordering is strictly unimportant except for the left of the pivot being < and the right of the pivot being >.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!