lec20 - 2/7/11 2/7/11 CS C341 / I S C361 Data Structures...

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

View Full Document Right Arrow Icon
Click to edit Master subtitle style 2/7/11 Sundar B. CS C341 / I S C361 Algorithm Design Techniques - GREEDY Types of Problems - Optimization Problems: Examples Greedy Algorithms - Examples - Task Scheduling - (Fractional) KnapSack - Greedy Choice Property - Optimal Substructure Property - Limitation 11
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/7/11 Sundar B. Types of Problems Decision Problems: E.g. Membership in a given set, Primality Testing General Description: Input Instance: x ϵ I, the set of all instances Property: A predicate P on I Query: Is P(x) true? 22
Background image of page 2
2/7/11 Sundar B. Types of Problems [2] Search Problems: E.g. Finding an element with a given key, Order/Rank Queries such as find the median or find the kth smallest element General Description: Input Instance: ls 5 I = Lists[E] where ls “ Lists[E], a set of collections of elements of type E. Property: A predicate P on E Query: Find a y ϵ ls such that P(y) is true. 33
Background image of page 3

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

View Full DocumentRight Arrow Icon
2/7/11 Sundar B. Types of Problems [3] Function Problems: E.g. gcd of two numbers, all substrings of a given string General Description: Input Instance: x ϵ I, the set of all instances Function: A function f on I Query: Compute f(x) 44
Background image of page 4
2/7/11 Sundar B. Types of Problems [4] Optimization Problems: E.g. Huffman Coding / Compression General Description: Input Instance : x ϵ I, the set of all instances Function: A function f : I -> S, where S is set of solutions Property: A predicate P on S Feasible Solutions: for each x, SOL(x) = { f(x) | P(f(x)) is true } 55
Background image of page 5

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

View Full DocumentRight Arrow Icon
2/7/11 Sundar B. Problem - Task Scheduling
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.

Page1 / 19

lec20 - 2/7/11 2/7/11 CS C341 / I S C361 Data Structures...

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