Coders Packet

Quick Sort using C++programming language.

By Srivenurajulu G

QuickSort follows the divide and conquer algorithm technique. It picks an element as a pivot and then it splits the given array around the picked pivot. element and then it is sorted. Using C++.

Definition:

QuickSort is a Divide and Conquer algorithm. It picks an element as a pivot and then it splits the given array around the picked pivot. element and then it is sorted.

Algorithm:

  1. Start
  2. Choose the highest index value a pivot.
  3. Take to variables to point left and right of the list excluding the pivot element.
  4. Left points to the low index and Right points to the high index
  5. Value at the left is lesser than pivot move right.
  6. Value at the right is greater than pivot move left
  7. If both step 5 and step 6 do not match swap left and right.
  8. If left is greater than equal to right the point where they met the new pivot.
  9. Stop.

For Example, if you give an array of size 4, elements are 9,2,8,0

Sorted Array is 0,2,8,9

 

Download project

Reviews Report

Submitted by Srivenurajulu G (Srivenurajulu)

Download packets of source code on Coders Packet