SCS B213_B
SCS B213_B
YEAR
i. Path
ii. Loop
iii. Degree
iv. Neighborhood
v. Dag
vi. Connected component (6 Marks)
b. Explain the three main asymptotic methods used to represent the rate of growth of running
time of an algorithms. (6 marks)
d. Insert 60, 30, 10, 20, 50, 40, 70, 80, 15, 90, 100 into a B-Tree (6 Marks)
f. Solve the following Knapsack Problem using Dynamic Method. Given that six items where:
Weight W = 10
Item 1 2 3 4 5 6
Weight (w) 4 2 3 1 6 4
c. Write down and explain the procedure for tackling the 8 - queens problem using a
backtracking approach. (5 Marks)
b. After a depth-first search in a graph, the edges of the graph are classified into 4 categories.
Briefly describe the four categories of edges (4 Marks)
56 23 18 89 46 77 88 36 74 63 14 (6 Marks)
f. Consider the weighted graph below apply Floyd-Warshall algorithm to find shorted path.
Compute matrix D of shortest path weights and then construct the predecessor matrix ∏ from
matrix D.
(8 Marks)
QUESTION 4(20 Marks)
i. Zig-Zag
ii. Zag-Zag
iii. Zag-Zig
iv. Zig-Zig (4 Marks)
b. Compare and constrast Bell-Ford and Dijkstra algorithms for single source path (4 Marks)
c. Explain the following methods of solving recurrence
i. Substitution method
ii. Iteration method
iii. Tree method (6 Marks)
d. Construct Huffman Tree for the following data set f:5 e:9 c:12 b:13 d:16 a:45 where alphabets
represent the data and numbers represent their corresponding frequencies. (6 Marks)