Download presentation
Presentation is loading. Please wait.
Published byJared Russell Modified over 8 years ago
2
Sorting Quick, Merge & Radix
3
Divide-and-conquer Technique subproblem 2 of size n/2 subproblem 1 of size n/2 a solution to subproblem 1 a solution to the original problem a solution to subproblem 2 a problem of size n
25
Best Case If we are lucky, Partition splits the array evenly
26
Worst Case What is the worst case? One side of the parition has only one element
27
Worst Case (2)
28
Merge Sort
29
Using Divide and Conquer: Mergesort Mergesort Strategy Sorted Merge Sorted Sort recursively by Mergesort first last (first last) 2
32
Algorithm
35
Radix Sort
40
Least-significant-digit-first Example: 275, 087, 426, 061, 509, 170, 677, 503
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.