Algorithms - Quick Sort

In this blog, I will create a small sample of quick sort algorithm using javascript and recursion.

Quick sort works on the principle of divide and conquer. First, we select a pivot value which can be any value in the array. Then based on this value we divide all other values in left and right groups. Once first iteration is done we call quick sort on left and right recursively and in the end merge the results to get a sorted output. Here is the code:

No comments: