10AlgorithmicComplexityII

10AlgorithmicComplexityII - CMSC 132: Object-Oriented...

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

View Full Document Right Arrow Icon
1 CMSC 132: Object-Oriented Programming II Algorithmic Complexity II Department of Computer Science University of Maryland, College Park
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Overview Critical sections Comparing complexity Types of complexity analysis
Background image of page 2
3 Analyzing Algorithms Goal Find asymptotic complexity of algorithm Approach Ignore less frequently executed parts of algorithm Find critical section of algorithm Determine how many times critical section is executed as function of problem size
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Critical Section of Algorithm Heart of algorithm Dominates overall execution time Characteristics Operation central to functioning of program Contained inside deeply nested loops Executed as often as any other part of algorithm Sources Loops Recursion
Background image of page 4
5 Critical Section Example 1 Code (for input size n ) 1. A 2. for (int i = 0; i < n ; i++) 3. B 4. C Code execution A once B n times C once Time 1 + n + 1 = O( n ) critical section
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Critical Section Example 2 Code (for input size n ) 1. A 2. for (int i = 0; i < n ; i++)
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/04/2011 for the course CMSC 132 taught by Professor Padua-perez during the Spring '08 term at Maryland.

Page1 / 15

10AlgorithmicComplexityII - CMSC 132: Object-Oriented...

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

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