id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

gaurav1780@gmail.com 07_recursion > quick_sort
prev  |  next  |  chance

You might want to study quick sort for a suitable time, and also implement it iteratively before you dive into this one. The challenge is to solve it purely recursively. No loops whatsoever. Define a function quickSort that when passed an array, a starting index and an ending index, sorts it using quick sort and returns the array.


quick_sort([8, 1, 9, 2, 5, 4, 3]) → [1, 2, 3, 4, 5, 8, 9]
quick_sort([7, 6, 8, 1, 9, 0, 2, 5, 4, 3]) → [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
quick_sort([1729]) → [1729]

...Save, Compile, Run (ctrl-enter)

def quick_sort(a):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 6 Post-solution available

Copyright Nick Parlante 2017 - privacy