lec9-10 - Click to edit Master subtitle style 2/7/11 Sundar...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Click to edit Master subtitle style 2/7/11 Sundar B. CS C341 / I S C361 Data Structures & Algorithms Sorting Performance and Applications Summary of Algorithms Comparative Performance of Algorithms Lower Bound on Comparison-based Sorting Sorting without Comparisons- Bucket Sorting- Radix Sorting Why Sort? Online vs. Offline, Preprocessing. Dictionary Data Structures 11 2/7/11 Sundar B. 2/7/11 Sundar B. Sorting Algorithms Comparison of Approaches Feature Algo. Insertion Sort Merge Sort QuickSort Ordering Principle Insertion preserves Order Merging preserves Order Partition induces Order Ranking Operation Compariso n Comparis on Comparis on Positioning Operation Shift Copy Exchange 2/7/11 22 Sundar B. 2/7/11 Sundar B. Sorting Performance Comparison Metric Algo. Insertion Sort Merge Sort QuickSort Worst Case Time O(N*N) O(NlogN) O(N*N) w. low prob. Average Case Time O(N*N) O(NlogN) O(NlogN) w. high prob. Performanc e on small lists Extremely good Not good Not good Space O(1) O(N) O(logN) Online/Offli Online Offline Offline 2/7/11 33 Sundar B. Why? 2/7/11 Sundar B. Sorting Lower Bound Is this the best we can do for Sorting? Algorithm Complexity vs. Problem Complexity Sorting Can be solved in polynomial time in particular in O(NlogN) time (worst case) Witness: Merge Sort Is there a lower bound (on time complexity) for sorting? i.e. is there a (lower) limit for the time taken for sorting a list of N elements using any sorting algorithm? 2/7/11 44 Sundar B. 2/7/11 Sundar B. Sorting Lower Bound [2] 2/7/11 55 Sundar B. { 8 2 9 1 7 7 1 -1 3 F 6 -4 F C 2 -8 D 4-5 6 4 9 6 2 F 3 F 5 B } A1<A2 { 2 D C 9 7 E F 2 -E 8 F 6 -4 8 9 0 -8 B E 0 -F E 4 8 D D 9 0 8 4 C } A2<A3 1,A2,A3 { 4 C 5 7 1 C 0 A -E 2 7 -4 D F -A 1 B -A 0 B 9 B 0 C D 9 D C } A1<A3 { A 7 E 8 2 D 3 F -5 B D C -4 A 0 -9 1 3 6 -4 E 9 6 8 9 5 8 E 2 8 6 } A3<A1 { A E C 3 4 A 6 -E 2 0 B -4 5 6 8 -B 5 6 2 -9 E 9 1 0 C F 2 E 9 C 2 }...
View Full Document

Page1 / 18

lec9-10 - Click to edit Master subtitle style 2/7/11 Sundar...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online