...

/

Overview of Quicksort

Overview of Quicksort

We'll cover the following...

Like merge sort, quicksort uses divide-and-conquer, and so it's a recursive algorithm. The way that quicksort uses divide-and-conquer is a little different from how merge sort does. In merge sort, the divide step does hardly anything, and all the real work happens in the combine step. Quicksort is the opposite: all the real work happens in the divide step. In fact, the combine step in quicksort does absolutely nothing.

Quicksort has a couple of other differences from merge sort. Quicksort works in place. And its worst-case running time is as bad as selection sort's and insertion sort's: Θ(n2)\Theta(n2). But its average-case running time is as good as merge sort's: Θ(nlogn ...

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy