(a) Write the Mergesort algorithm to sort n elements using divide and conquer strategy. (b) Define feasible solution and optimal solution. Write the…

(a) Write the Mergesort algorithm to sort n elements using divide and conquer strategy.

(b) Define feasible solution and optimal solution. Write the greedy algorithm to generate the single-source shortest path of a graph.

(c) Consider a sum of subset problem n = 4, w = (w1, w2, w3, w4) = (11, 13, 24, 6) and m = 30. Find all possible subsets of w that sum to m. Draw the possible solution space tree of this problem and indicate the answer nodes.

(d) Define the following terms with example: Backtracking, NP, NP-Hard, and NP-complete problem.

(e) Define deadlock in operating system. Draw a proper diagram to show a deadlock situation and discuss in brief.

From the BCS Technical Cadre (CSE) January 2024 – 45th BCS Written (BPSC) exam, question 5 of 8.

More from this paper