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.

I need help with my Quicksort program. I need to write a

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

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!