CAS 702 – Data Structures and Algorithms – Final Exam – 60p
December 14, 2007 – duration of the exam: 3 hours
Name:
Student Number:
Signature:
Problem 1
a.
Prove or disprove the following:
f
(
n
) = Θ(
f
(
n/
2)).
5p
b.
Consider the following: An array of
n
numbers contains only
−
1
,
0 and 1 can be
sorted in
O
(
n
) time in the worst case. If
true
, describe an
O
(
n
) time algorithm
briefly (you are
not
required to prove its correctness), if
false
give the correct worst
case running time.
5p
c.
Prove or disprove the following: If a node in a binary search tree has two children,
then its successor has no left child and its predecessor has no right child.
5p
Problem 2
Consider a positive flow
f
in a network
G
= (
V, E
).
We wish to decompose
f
into
positive simple path (or cycle) flows
f
i
, i.e.
f
=
∑
f
i
, where the edges of
f
i
form a
simple path form
s
to
t
in
G
, or any cycle in
G
. (Recall: a
simple path
has no repeated
vertices, and a
simple cycle
has no repeated vertices aside from the start/end vertex).
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.
 Fall '09
 Zera
 Graph Theory, Glossary of graph theory, Dijkstra, simple path

Click to edit the document details