22
C
: 231
Design and Analysis of Algorithms
Midterm Exam
The duration of this exam is one hour and Ffteen minutes. This is a closedbook exam.
1. (10 points)
(a) We are given a ±ow network
G
with vertex set
V
and a nonnegative integer
capacity
c
(
u, v
) for any edge (
u, v
)
∈
V
×
V
. We are also speciFed a source
s
∈
V
and a sink
t
∈
V
.
State the deFnition of a ±ow in the network
G
.
DeFne the
value of the ±ow.
(b) Consider the Fgure on the next page.
What is the value of the ±ow that is
depicted?
(c) Argue that ±ow conservation holds at
v
3
.
(d) Argue that the ±ow depicted is a maximum ±ow.
(e) In the Fgure, what is the capacity of the minimumcapacity
s

t
cut?
2. (10 points) We are given a sequence
S
=
h
s
1
, s
2
, . . . , s
n
i
of
n
distinct positive in
tegers.
The sequence is not necessarily sorted.
The problem is to develop an al
gorithm for Fnding the longest increasing subsequence of
S
.
²or example, if
S
=
h
100
,
10
,
60
,
70
,
20
,
30
,
40
,
80
i
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '09
 Naver
 Algorithms, Graph Theory, Natural number, longest increasing subsequence

Click to edit the document details