Question: Test your implementation on two worst case instances and make sure you get the correct number of comparisons. L2 = list(range(10)) numberOfComps = QuickSort3(L2, 0,
Test your implementation on two worst case instances and make sure you get the correct number of comparisons.
L2 = list(range(10))
numberOfComps = QuickSort3(L2, 0, len(L2) - 1, 0)
print(L2, "Number of comparisons: ", numberOfComps)
L3 = list(range(10)[-1::-1])
numberOfComps = QuickSort2(L3, 0, len(L3) - 1, 0)
print(L3, "Number of comparisons: ", numberOfComps)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
