CAS 702 – Data Structures and Algorithms – Final Exam – 60p
December 8, 2008 – duration of the exam: 3 hours
Name:
Student Number:
Signature:
Problem 1
a.
Prove that (lg
n
)
b
=
O
(
n
a
) where
a
and
b
are strictly positive constants.
5p
b.
Show how can the output of the FloydWarshall algorithm be used to detect the presence
of a negativeweight cycle on a simple directed graph.
5p
c.
Assuming that the best running time of a comparison based algorithm to sort
n
elements is
Θ(
n
lg
n
), prove that the running time of constructing a binary search tree from an arbitrary
list of
n
elements can not be Θ(
n
).
5p
Problem 2
Consider a function
φ
=
c
0
+
∑
n
i
=1
c
i
x
i
+
∑
1
≤
i<j
≤
n
c
ij
x
i
x
j
where
c
0
,
c
i
, and
c
ij
are given constant
coefficients, and
x
i
∈ {
0
,
1
}
. First,
φ
can be transformed into an equivalent form
φ
+
such that all
the coefficients are nonnegative by replacing some
x
i
by 1
−
¯
x
i
(note that ¯
x
i
∈ {
0
,
1
}
). Then, by
replacing some
x
i
and ¯
x
i
by 1
−
¯
x
i
and 1
−
x
i
respectively,
φ
+
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, cij xi xj, simple directed graph

Click to edit the document details