O'Reilly logo

Learning Functional Data Structures and Algorithms by Raju Kumar Mishra, Atul Khot

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Quick sort

Quick sort is also known as partition exchange sort. It was developed by Tony Hoare. Quick sort also utilizes the power of divide and conquer, which we came to understand in the previous section. It is just about dividing a problem into approximately similar sub problems, solving each sub problem separately, and combining the results of the sub problems to deliver the final result.

Quick sort steps can be laid out in following fashion:

  1. We select a pivot element. Selecting a proper pivot is very necessary for efficiency in a quick sort algorithm.
  2. We put the pivot element in such a location that all the elements on its left are less than the pivot element, and all the elements on its right are greater than the pivot. This way, we partition ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required