MALAWI UNIVERSITY OF SCIENCE AND TECHNOLOGY
MALAWI INSTITUTE OF TECHNOLOGY
COMPUTER SCIENCE AND INFORMATION TECHNOLOGY DEPARTMENT
DSAL-211 ASSIGNMENT 1
DUE DATE: Friday, 8th February 2019 Time: 5 P.M
INSTRUCTIONS
1. Answer ALL questions. Marks will only be awarded for correct answers that demonstrate
independence of thought, thorough research and comprehensive understanding of the
subject
2. This is an individual assignment, hence, you are NOT allowed to work in groups. Content
that demonstrates similarities shall be penalized
3. Submit your work not later than the deadline in Admin Block Room 87 or at the Reception
via Mr. Gondwe’s pigeonhole.
1. Prove the following by mathematical induction:
𝑛
a. ∑𝑘=1 2𝑘 = 2𝑛+1 − 2, 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑛 > 0 [8 marks]
b. 7𝑘 − 1 𝑖𝑠 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 6 for all positive integers k [6 marks]
2. Explain how the following algorithm design approaches work
a. Greedy algorithm [3 marks]
b. Dynamic programming [3 marks]
3. Dijkstra’s algorithm is a shortest-path graph algorithm with many applications in
optimization. Use your knowledge of the algorithm to find the shortest path from node A to
node I in the graph given below. Outline all steps. [10 marks]
4. Outline an algorithm for detecting a cycle in an undirected graph using depth first search
(DFS) [10 marks]