Exam 1-2013
1.
Write an algorithm to detect if a given undirected graph
contains a cycle.
2.
Consider a directed acyclic graph. How many topological
orderings does it have?
3 . Compose the distance matrix for a graph
4.
Write an algorithm for finding shor
Exam 2- 2013
1.
For an O(n2) algorithm, one data set with input size n = 3
takes 54 seconds. How long will it take for a data set for n = 2 and n
= 5?
2.
For an O(2n) algorithm, a friend tells you that it takes 16
seconds to run her data set on a machine.