I have the following question please:
Consider the following sequence of numbers 8, 1, 11, 4, 2, 9, 10, 5, 3, 12, 6, 7
Sort the list using quick sort with the middle element as pivot.
Show the state of the list after each call to the partition
procedure.
You are not required to write code for this question. You need to
trace through the different sorting algorithms using the given
list
Please could you provide me with a complete answer as well an explanation of how you got to that answer. I'm having a really difficult time understanding this question
Thank you
`Hey,
Note: In case of any queries, just comment in box I would be very happy to assist all your queries
[8, 1, 11, 4, 2, 9, 10, 5, 3, 12, 6, 7]
[8,1,3,4,5,3,6,7,9,10]----[11,12]
[1,3,3]---[8,4,5,6,7,9,10]----[11]----[12]
[1,3]--[3]---[4,5,6]---[8,7,9,10]----[11]---[12]
[1]---[3]---[3]---[4,5]---[6]-----[8,7,9]----[10]---[11]---[12]
[1]---[3]---[3]---[4]----[5]---[6]-----[7]----[8,9]----[10]---[11]---[12]
[1]---[3]---[3]---[4]----[5]---[6]-----[7]----[8]----[9]----[10]---[11]---[12]
[1,3]--[3]--[4,5]---[6]--[7]--[8,9]--[10]---[11]---[12]
[1,3,3]---[4,5,6]---[6]---[7,8,9]----[10]---[11]---[12]
[1,3,3,4,5,6,7,8,9,10,11,12]
Kindly revert for any queries
Thanks.
Get Answers For Free
Most questions answered within 1 hours.