html Quicksort-For-Experts

Quicksort-For-Experts

You've reached the pinnacle of sock-sorting sophistication! This is the place where the most discerning experts congregate to discuss the art of Quicksort.

				function quiksort(arr) {
					if (arr.length <= 1) {
						return arr;
					}
					var pivot = arr[0];
					var less = [];
					var more = [];
					for (var i = 1; i < arr.length; i++) {
						if (arr[i] < pivot) {
							less.push(arr[i]);
						} else {
							more.push(arr[i]);
						}
					}
					return quiksort(less).concat(pivot, quiksort(more));
				}
			

Now, if you're ready to take your Quicksort to the next level, click on one of the links above.