Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross swap me
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross swap me
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross swap me
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross swap me
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross swap me
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross swap me
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross swap me
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross swap me
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross swap me
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross swap me
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross swap me
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross pointers cross swap with partitioning element
Partitioning in Quicksort n How do we partition the array efficiently? – choose partition element to be rightmost element – scan from right for smaller element – scan from left for larger element – exchange – repeat until pointers cross