Quick Sort : Java Sorting Program Code

Quick sort is based on one principle divide and conquer  . Quick sort first divides the large lists into two sub smaller lists ,the low elements and the high elements .Quick sort can then recursively sort the sublists.

Read Also :   Selection Sort : Explained Along With Java Program Code

* Choose an element and called it as pivot , in the given list .

Reorder the list so that all elements with values less than the pivot come before the pivot, while all elements
   with values greater than the pivot come after it (equal values can go either way). After this partitioning pivot  is in  its final position. This is called the partition operation.  

* Recursively apply the above steps to the sublists of the elements with smaller values and separately the   sublists of elements with  greater values.

It is also known as partition exchange sort .Quicksort's sequential and localized memory references work with a cache .
Quick Sort : Java Sorting Program Code Quick Sort : Java Sorting Program Code Reviewed by Anonymous J on 03:10:00 Rating: 5
Powered by Blogger.