sorting quick, merge radix divide-and-conquer technique subproblem 2 of size n/2 subproblem 1 of...

Download Sorting Quick, Merge  Radix Divide-and-conquer Technique subproblem 2 of size n/2 subproblem 1 of size n/2 a solution to subproblem 1 a solution to

If you can't read please download the document

Upload: jared-russell

Post on 18-Jan-2018

223 views

Category:

Documents


0 download

DESCRIPTION

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

TRANSCRIPT

Sorting Quick, Merge & Radix 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 Best Case If we are lucky, Partition splits the array evenly Worst Case What is the worst case? One side of the parition has only one element Worst Case (2) Merge Sort Using Divide and Conquer: Mergesort Mergesort Strategy Sorted Merge Sorted Sort recursively by Mergesort first last (first last) 2 Algorithm Radix Sort Least-significant-digit-first Example: 275, 087, 426, 061, 509, 170, 677, 503