Candidates Are Required To Give Their Answers in Their Own Words As Far As Practicable. The Figures in The Margin Indicate Full Marks
Candidates Are Required To Give Their Answers in Their Own Words As Far As Practicable. The Figures in The Margin Indicate Full Marks
1. a) Define the asymptotic notations Big Oh, Big Omega, and Big Theta. 3+4
Show that the following inequality is correct:
5n2 – 6n = Ө (n2)
b) Briefly explain Binary Search Tree data Structure. Write an 3+5
algorithm to delete an element from the binary search tree and find
the time complexity of your algorithm.
2. a) Briefly explain the Divide and Conquer in Merge-Sort Algorithm. 7
Show that the time complexity of Merge-Short algorithm is O(n log
n) where n is the number of elements in the list to be sorted.
b) Briefly explain the fractional knapsack problem. Consider five items 8
along with their respective weights and values as follows:
Items: I = {I1, I2, I3, I4, I5,}
Weitht: w = 5, 10, 20, 30, 40}
Profit value v = {30, 20, 100, 90, 160}
The knapsack has the capacity W = 60. Find an optimal solution to the
fractional knapsack problem.
3. a) Briefly explain the Optimal Storage on Magnetic Tape problem. 3+5
Consider three files, their length given by {I 1, I2, I3) = {5, 10, 3}.
Find the Optimal Storage of ordering of files on magnetic tape.
b) What is dynamic programming? Explain the benefit of applying 7
dynamic programming with an example.
4. a) Let X = a a b a and Y = b a b. Find a minimum-cost that require to 8
change X into Y in which, each insertion and deletion costs 1 unit
and change costs 2 unit.
b) Let A, B and C be three matices such that C = A X B. Let the 7
1
dimension of A B and C be n x n. Write an algorithm to compute the
matrix C, and compute its complexity.
5. a) Write an algorithm to count the number of leaf nodes in a binary tree 7
t. What is the computing time of your algorithm?
b) Write an algorithm for Breadth First Search (BFS). Show that for any 8
undirected graph G = (V, E) a call to BFS (v) with v Є V results in
visiting all the vertices in the connected component containing v.
6. a) Briefly explain the concept of Backtracking method. Write an 8
algorithm to solve the 8 queens problem.
b) Explain the sum of Subset problem. Given a set S = {1, 3, 4, 5} and 7
X = 8. Find the sum of subset using backtracking approach.
7. Write short notes on (Any Two) 2×5
a) Strassen’s Matrix Multiplication
b) Kruskals Algorithm
c) Tree Vertex Splitting Problem