Skip to main content

Posts

Showing posts with the label QuickSort

All you need to know about Quick Sort Algorithm.

Introduction to Quick Sort Algorithm. A sorting algorithm basically sorts the data structure like array or list in certain order. The order either may be the numerical order or alphabetical order. A Quick-Sort Algorithm is one of the fastest sorting algorithms, which sorts the array based on partitioning the array by choosing an element of the same array as a pivot. All element greater than the pivot are moved to the right direction and all element smaller than the pivot are moved to left. The basic idea of this algorithm is to select a pivot element in an array and to put the pivot element in its right place and move all smaller entries than pivot of the array to left, and greater entries than pivot to right of the array.  Now the array is divided into two part one part of greater entries than the pivot and another part of the smaller entries than the current pivot element. Now the two-part are recursively applied quicksort to left part and to the righ...