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

 

quickSort


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.


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

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

int[] quickSort(int[] 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

Java Help

Misc Code Practice

Difficulty: 5 Post-solution available

Copyright Nick Parlante 2017 - privacy