Question: I need help with my Quicksort program. I need to write a program that generates about 4 numbers from 1000 - 10000 and sorts them
I need help with my Quicksort program. I need to write a program that generates about 4 numbers from 1000 - 10000 and sorts them in python. It also gives the execution time of the program. This is the desired output.

This is my code so far.
def quickSort(numList, f, l): """ Quick sort function """ # Finding length n = len(numList) # Loop till first is less than last if f = x and right >= left: right-=1 # Break point if right
import random # Random testing
# Testing five different cases for k in range(5): # Generating a random length randNum = random.randrange(10) # Creating list lst = [random.randrange(100) for i in range(randNum)] print(" Before Sorting: ", end=" ") print(lst)
Before quicksort: 1000 5050 9000 3560 After quicksort: 1000 3560 5050 9000 Elapsed time is: 0.000002 seconds 5 Before quicksort: 1000 5050 9000 3560 After quicksort: 1000 3560 5050 9000 Elapsed time is: 0.000002 seconds 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
