C++ Example – Quick Sort Algorithm

Basic Idea

  • Pick one element in the array, which will be the pivot.
  • Make one pass through the array, called a partition step, re-arranging the entries so that:
    • entries smaller than the pivot are to the left of the pivot.
    • entries larger than the pivot are to the right
  • Recursively apply quicksort to the part of the array that is to the left of the pivot, and to the part on its right.
  • No merge step, at the end all the elements are in the proper order

In this lesson we will learn how to write a source code in C++ programming language for doing simple quick sort using array in ascending order.
Online computer science courses to jumpstart your future.
Quick Sort Example :


Partner Sites




Stuff I use to make videos

Windows notebook – http://amzn.to/2zcXPyF

Apple MacBook Pro – http://amzn.to/2BTJBZ7

Desktop - http://amzn.to/2zct252

Microphone – http://amzn.to/2zcYbW1

notebook mouse – http://amzn.to/2BVs4Q3

Screen Recording Software – Camtasia