Solution Found!
Illustrate QuickSort as above using the list 8, 4, 10, 5, 9, 6, 14, 3, 1, 12, 11
Chapter 3, Problem 26(choose chapter or problem)
QUESTION:
Illustrate QuickSort as above using the list 8, 4, 10, 5, 9, 6, 14, 3, 1, 12, 11.
Questions & Answers
QUESTION:
Illustrate QuickSort as above using the list 8, 4, 10, 5, 9, 6, 14, 3, 1, 12, 11.
ANSWER:Step 1 of 5
The given list is 8, 4, 10, 5, 9, 6, 14, 3, 1, 12, 11. The pivot element is 8. Compare pivot element with all the elements in the list forming two list L1 and L2.
Compare 8 and 4, 4 is placed in L1.
Compare 8 and 10, 10 is placed in L2.
Compare 8 and 5, 5 is placed in L1.
And so on.
The two lists formed are as below-
L1: 4, 5, 6, 3, 1
L2: 10, 9, 14, 12, 11
After the first pass, the list is 4, 5, 6, 3, 1, [8], 10, 9, 14, 12, 11.