Midterm II, Part 2 Version A Solution
Nov. 18, 2011 2:00pm - 2:50pm CS431 CS531 (Please circle one)
First Name (Print): UB ID number:
Last Name (Print):
1. This is a closed book, closed notes exam. 2. You must support your answer. 3. If you need more spac
Midterm I, Part 2 Version B
Oct. 10, 2011 2:00pm - 2:50pm CS431 CS531 (Please circle one)
First Name (Print): UB ID number:
Last Name (Print):
1. This is a closed book, closed notes exam. 2. You must support your answer. 3. Write your name on the top righ
Assignment #2 CS4/531
Due Date: Tuesday, Oct. 3, 2011 UNSUPPORTED SOLUTIONS RECEIVE NO CREDIT. Total points: 53 1. (5 pts) Let a be a real number and n a positive integer. We want to compute an . This, of course, can be done using n - 1 multiplications. D
Outline
1
Greedy Algorithms Elements of Greedy Algorithms Greedy Choice Property for Kruskal's Algorithm 0/1 Knapsack Problem Activity Selection Problem Scheduling All Intervals
2
3
4
5
6
c Xin He (University at Buffalo)
CSE 431/531 Algorithm Analysis and
Assignment #6, CS4/531
Due Date: Friday. Dec. 9, 2011 Total points: 52
You MUST turn in your HW by 2:10pm on Dec 9. After that, I will NOT accept your HW. This rule will be STRICTLY ENFORCED. Please PRINT YOUR LAST NAME, FIRST NAME and UB number on the f
Assignment #6, CS4/531
Solution Due Date: Friday. Dec. 9, 2011 Total points: 52
You MUST turn in your HW by 2:10pm on Dec 9. After that, I will NOT accept your HW. This rule will be STRICTLY ENFORCED. Please PRINT YOUR LAST NAME, FIRST NAME and UB number
Midterm II, Part 1 Version A
Nov. 16, 2011 2:00pm - 2:50pm CS431 CS531 (Please circle one)
First Name (Print): UB ID number:
Last Name (Print):
1. This is a closed book, closed notes exam. 2. You must support your answer. 3. Write your name on the top rig
Midterm I, Part 1 Version A
Oct. 10, 2011 2:00pm - 2:50pm CS431 CS531 (Please circle one)
First Name (Print): UB ID number:
Last Name (Print):
1. This is a closed book, closed notes exam. 2. You must support your answer. 3. Write your name on the top righ
Midterm I, Part 1 Version B
Oct. 10, 2011 2:00pm - 2:50pm CS431 CS531 (Please circle one)
First Name (Print): UB ID number:
Last Name (Print):
1. This is a closed book, closed notes exam. 2. You must support your answer. 3. Write your name on the top righ
CSE 431/531: Analysis of Algorithms
Introduction and Syllabus
Lecturer: Shi Li
Department of Computer Science and Engineering
University at Buffalo
Fall 2016
MoWeFr 9:00-9:50pm
Cooke 121
Outline
1
Syllabus
2
Introduction
What is an Algorithm?
Example: Ins
Assignment #5, CS4/531
Due Date: Monday. Nov. 28, 2011 Total points: 47
You MUST turn in your HW by 2:10pm on Nov 28. After that, I will NOT accept your HW. This rule will be STRICTLY ENFORCED. Please PRINT YOUR LAST NAME, FIRST NAME and UB number on the
Assignment #5, CS4/531
Due Date: Monday. Nov. 28, 2011 Total points: 47
You MUST turn in your HW by 2:10pm on Nov 28. After that, I will NOT accept your HW. This rule will be STRICTLY ENFORCED. Please PRINT YOUR LAST NAME, FIRST NAME and UB number on the
Outline
1
Single Source Shortest Path Problem Dijkstra's Algorithm Bellman-Ford Algorithm All Pairs Shortest Path (APSP) Problem Floyd-Warshall Algorithm
2
3
4
5
c Xin He (University at Buffalo)
CSE 431/531 Algorithm Analysis and Design
1 / 36
Single Sour
Single Source Shortest Path (SSSP) Problem
Single Source Shortest Path Problem
Input: A directed graph G = (V, E); an edge weight function w : E R, and a start vertex s V. Find: for each vertex u V, (s, u) = the length of the shortest path from s to u, an
Max-Flow Problems
Max-Flow is a graph problem that seems very specific and narrowly defined. But many seemingly unrelated problems can be converted to max-flow problems.
A flow network consists of:
A directed graph G = (V, E). Each edge u v E has a capaci
Outline
1
HC is N PC
2
Subset-Sum is N PC
c Xin He (University at Buffalo)
CSE 431/531 Algorithm Analysis and Design
1 / 27
HC is N PC
HC is N PC
We have shown HC is in N P. We show HC is N P-hard by showing 3SAT P HC.
c Xin He (University at Buffalo)
CSE
Assignment #3, CS/531
Due Date: Monday, Oct. 24, 2011 Total points: 47 You MUST turn in your HW by 2:10pm on Oct 21. After that, I will NOT accept your HW. This rule will be STRICTLY ENFORCED. Please PRINT YOUR LAST NAME, FIRST NAME and UB number on the f
Assignment #3, CS/531
Due Date: Thur. Oct. 24, 2011 UNSUPPORTED SOLUTIONS RECEIVE NO CREDIT. Total points: 47 1. (2+6 = 8 pts) A local tennis club is going to have a tournament to decide the 1st and the 2nd place player among n players. The tournament is
Assignment #4, CS/531
Due Date: Mon. Nov. 7, 2011 UNSUPPORTED SOLUTIONS RECEIVE NO CREDIT. Total points: 51 1 (7 pts). Maximum Contiguous Subsequence Sum Problem revisited. Let A[1.n] be an array of numbers. The elements in A can be either positive or neg
Assignment #4, CS/531
Due Date: Mon. Nov. 7, 2011 UNSUPPORTED SOLUTIONS RECEIVE NO CREDIT. Total points: 51 1 (7 pts). Maximum Contiguous Subsequence Sum Problem revisited. Let A[1.n] be an array of numbers. The elements in A can be either positive or neg
y i y
ov
q pi ki
rofoouldjp
p v p i k v w ff i y
qAonmloroDoi i rv&s9z cfw_ &jDtix
qp
f p km p x
q q p z
zz yx z yx x cfw_ z yx z yx i i f u vy w k y i y
ixi(iifF%t%&`r09|ov
z x z x z x z yx i zz yx z yx
yxy2yid1ieix
ui v fi f p km p
ont %& grv&