Download presentation
Presentation is loading. Please wait.
Published byKelley Lamb Modified over 8 years ago
1
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
2
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
3
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
4
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
5
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
6
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
7
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
8
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
9
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
10
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
11
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
12
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
13
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
14
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
15
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
16
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
17
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
18
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
19
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.