Link Search Close Search Menu Expand Document

Quick Sort

Quick sort is a very efficient sorting algorithm and most commonly used for sorting.
It uses divide and conquer technique.
It chooses one element as pivot (We are using last element as pivot).
It partitions the other elements into two parts, where elements in first part are less than the pivot and elements in second part are higher than the pivot.
Each partition is sorted recursively.
It has best and average case complexity of O(n log n) and worst case complexity of O($n^2$).

Visualization of Quick Sort

Implementation of Quick Sort





Back to top

Copyright © 2020-2021 Gajanan Bhat. All rights reserved.