## Another divide-and-conquer algorithm

- The array A[p..r] is partitioned into two non-empty subarrays A[p..q] and A[q+1..r]
- Invariant: All elements in A[p..q] are less than all elements in A[q+1..r]

- The subarrays are recursively sorted by calls to quicksort
- Unlike merge sort, no combining step: two subarrays form an already-sorted array

- The array A[p..r] is partitioned into two non-empty subarrays A[p..q] and A[q+1..r]

Previous slide | Next slide | Back to first slide | View graphic version |