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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!