Quick Sort
Problem statement
Write a python program to sort the given list using quick sort
algorithm.
Examples:
Solution key
CloudCoder exercises
[To be updated]
Pre-Lab Questions
Quick sort uses
___________
.a. Divide and Conquer Technique
b. Greedy Approach
c. Back Tracking
d. None of the above
How to select a pivot element?
Given the following list of numbers
[1, 20, 11, 5, 2, 9, 16, 14, 13, 19]
what would be the first pivot value using the median method?Given the following list of numbers
[14, 17, 13, 15, 19, 10, 3, 16, 9, 12]
what is the contents of the list after the second partitioning according to thequicksort
algorithm?What is the average case complexity for quick sort algorithm?
a.
O(n)
b.
O(n*n)
c.
O(nlogn)
d.
O(logn)
What is the worst case complexity for quick sort algorithm?
a.
O(n)
b.
O(n*n)
c.
O(nlogn)
d.
O(logn)
Post-Lab Questions
What are the advantages and disadvantages of quick sort?
List out the applications of quick sort.
If the list is empty, what will be the value returned from the function?
If the list contain any string element, what will be the value returned from the function?
Does the selection of pivot element help to optimize the quick sort algorithm performance?
Bonus
Interview Grade
Related Material
The Quicksort Dance
Compare Merge and Quick
http://j.mp/mergeVsQuick
Last updated