Design and Analysis of AlgorithmTest2
Design and Analysis of AlgorithmTest2
Illustrate the Kruskal and the Prim Algorithm on the graphs below to determine the MST.
a)
B 8 7
C D
4 2 4 9
A 1 14
H E
8 7 6 10
1 2 F
I G
Knapsack of capacity W = 5
1 2 $12
2 1 $10
3 3 $20
4 2 $15
The Warshall algorithm and the Floyd algorithms are dynamic programming algorithms. Given the
explanation below draw the graph.
Mr Sidimeli (Chief technician in the department) wants to have a new network in the department. His
role is to come up with the shortest cable link that link the department as follows:
Use the Flyod algorithms to determine the minimum cables Mr. Sidimeli can use. Do up to D 2
Question 5
given g(n) =lg3n and f(n) = n0.5 . Prove that g(n) €o(f(n)) [8 marks]
Question 6
For the following recurrence equation states the type and solve to the point of the particular equation
where appropriate.
Question 7
a) Use Quick sort algorithm to illustrate the divide and conquer approach
Question 8
6
Illustrate both the divide and conguer and dynamic for the binomial coefficients on (p+q) for the
6
coeffients C3 [6 marks]