CS300-02_Algorithm_Analysis

# CS300-02_Algorithm_Analysis - Lower Bounds and the...

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

11 Lower Bounds and the Complexity of Problems P 1: Given n numbers, read and print them in the reverse order. Can you solve this problem in less than O( n ) time ? P 2: Given two polygons with n vertices, construct its intersection. Can you solve this problem in less than O( n 2) time ? Well, … O( n 2) points

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

View Full Document
22 P 3: Given a value x and an array L containing n entries sorted in the ascend- ing order, find an index of x in the list or return 0 as the answer if x is not in the list. Can you solve this problem in less than O(log n ) time ? Definition : (worst-case tight) Lower bound A lower bound in time complexity of a problem is the least amount of time to solve the most difficult instance of the problem. Trivial lower bound input / output Non-trivial lower bound hard to obtain
33 How to Obtain a Lower Bound P : Given a list of n numbers, find the largest one. P′ : Given a list of n distinct numbers, find the largest one. 1 A lower bound for P′ is also a lower bound for P . (although it may not be tight)

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

View Full Document
44 What is a lower bound for P′ ? (1) Trivial lower bound: c T n, c > 0 Why ? (2) Winner / loser argument 1 loser / comparison To determine the largest one, n - 1 losers must be set aside. 1 ( n - 1) comparisons are required. (3) (By adversary argument) Fewer than n-1 comparisons 1 Two non-losers including the winner Contradiction Why ? 1 L ( P′ ) = c n Since P′n P , L ( P ) = c n
55 Finding a Lower Bound Direct method Examining the size of an input / output Finding a lower bound for an instance of a problem Decision tree Indirect method Via reducibility (transformability) Note: There are many other ways.

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

View Full Document
: Given input (problem instance) I , find a solution for I . D
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 10/07/2010 for the course CS 300 taught by Professor Shin during the Spring '10 term at Korea Advanced Institute of Science and Technology.

### Page1 / 26

CS300-02_Algorithm_Analysis - Lower Bounds and the...

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

View Full Document
Ask a homework question - tutors are online