Quicksort
Learn about quicksort, an efficient recursive algorithm for sorting arrays or lists of values.
StartKey Concepts
Review core concepts you need to learn to master this subject
Quick Sort Performance
Quick Sort Performance
Quicksort’s performance can be inefficient when the algorithm encounters imbalanced partitions. The worst case scenario is if the first or last element is always the partition point for an array or sub-array. In this case, one side of the partition will contain all the elements. This makes the recursive stack deeper, resulting in O(N^2)
runtime.
Quicksort: Conceptual
Lesson 1 of 2
- 1Quicksort is an efficient recursive algorithm for sorting arrays or lists of values. The algorithm is a comparison sort, where values are ordered by a comparison operation such as > or <. Quick…
- 2The key to Quicksort’s runtime efficiency is the division of the array. The array is partitioned according to comparisons with the pivot element, so which pivot is the optimal choice to produce su…
- 3Quicksort is an efficient algorithm for sorting values in a list. A single element, the pivot, is chosen from the list. All the remaining values are partitioned into two sub-lists containing the v…
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory