Analysis of Algorithms: CSE 5210 Fall 2012
THREE QUESTIONS IN TWO PAGES
Quiz 1 Points 20
Q2. What is the asymptotic time-complexity of the following pseudo-code fragment in
terms of n:
For i = 1 to n do
For j = i to n do
For k = 1 to 3 do
Count+;
[5]
Q2.
Intro to Analysis of Algorithms
CSE 4081
Fall 2012
Points 35
Time 60 min
Four pages
Exam 1
[Ignore these key words: Foundations, Problem solving, Algorithm understanding.]
Q1. Solve the following 0-1 Knapsack problem using the dynamic programming
algorith
CSE 5211/ 4081 Analysis of Algorithms Fall 2012
(Five Questions, answer double sided if possible) Points 50
Final
Time 100 min
Q1. Write a dynamic programming algorithm for computing C(p, q) from the following
formula, where p and q are two integers, and
Analysis of Algorithms
CSE 5211
Fall 2012
Quiz 1
Points 45
Intro to Analysis of Algorithms
CSE 4081
Fall 2010
Quiz 1 Points 40
Time: 45 min
The following recursive algorithm finds k-th largest element in an unsorted array A.
Set up a recurrence equation f
Linear Programming (based on Coremen et al.)
LP in Standard form
Find values for n variables x1, x2, , xn:
Maximize (j=1n cj xj)
Subject to:
j=1n aij xj bi, for i = 1, m
for all j = 1,n, xj 0
(Maximize the objective function)
(subject to m linear constrai
GRAPH ALGORITHMS
Definitions (background):
Graph: nodes/vertices, and edges/arcs as pairs of nodes. cfw_V, E
e12=(v1, v2, l12)
The third term l12, if present, could be a label or the weight of an
edge.
Directed graph: edges are ordered pairs of nodes.
Wei
INTRODUCTION
Why write algorithms:
(1) To get it out of the head, human memory is unreliable!
(2) To communicate with the programmer and other algorithm
developers.
(3) To prove its correctness, to analyze, to improve its efficiency,
ALGORITHM:
What is a
Analysis of Algorithms
CSE 5212
Fall 2011
Final Exam
Points 60
Intro to Analysis of Algorithms
CSE 4081
Fall 2012
Final Exam
Pts 60
Time: 110 min
Q1. The following is a directed graph G:
V= cfw_a, b, c, d, e, f, g, h, i
E= cfw_(a, b), (a, d), (b, c), (c,
Intro to Analysis of Algorithms
CSE 4081
Points 30
Time 60 min
Fall 2013 2012
Exam 2
[Ignore these key words: Problem solving, Algorithm understanding.]
Q1. The following is a directed graph G = cfw_V, E:
V= cfw_a, b, c, d, e, f, g
E= cfw_(a, b), (c, a),
Analysis of Algorithms
Points 35 Time 70 min
CSE 5210
Fall 2012
(four questions)
Quiz 3
Q1. Basics: What is the time and space complexity of the following pseudo-code
fragment in terms of n:
For i = 1 to 3 do
For j = 1 to n do
For k = n downto j do
Count+
CSE 5211
Fall 2012
Homework
Points: 20
Due: 9/23/08
1. The following is a recurrence formula. Write a Dynamic Programming algorithm for
computing a[i,j], 0<cfw_i, j N, where N is a constant.
a[i, 0]= -2i, a[0, j]= -2j,
a[i, j] = maxcfw_a[i-1,j]-2, a[i, j-