Thread:Mathmagician/@comment-3562424-20121121052230/@comment-4674838-20121128042916

Well, it doesn't actually work yet, so until the algorithm is bug free, it's hard to say.
 * 1) array.length should be data.length
 * 2) make sure to recursively call quicksort to sort the entire array. it isn't enough to just put stuff into the lesser and greater halves once, you have to do that recursively until the whole array is sorted
 * 3) think about the recursive logic a bit more. You are assuming that eventually the less and greater arrays will each have one element, at which point you reach the base case of data.length <= 1 and exit. But does that actually happen?
 * 4) *Consider the array [1, 2] -- the pivot is 2. Both 1 and 2 are <= pivot, so less = [1, 2] and greater = [] -- this will put you in an infinite recursive loop and you'll never reach your current base case (you would see an error message in the console like "maximum stack size exceeded" because the infinite recursion would make too many function calls)