Daa Am 2011 - Cse Tube Q1
Daa Am 2011 - Cse Tube Q1
in
in
1. Using the step count method analyze the time complexity when 2 m × n
matrices are added.
2. An array has exactly n nodes. They are filled from the set {0, 1, 2,...,n-1, n}.
e.
There are no duplicates in the list. Design an O(n) worst case time algorithm to
find which one of the elements from the above set is missing in the array.
3. Show the intermediate steps when the numbers 123, 23, 1, 43, 54, 36, 75, 34
are sorted using merge sort.
ub
4. Devise an algorithm to make a change for 1655 using the Greedy strategy. The
coins available are {1000, 500, 100, 50, 20, 10, 5}.
5. Write the difference between Greedy Method and Dynamic Programming.
6. Write an algorithm to find the shortest path between all pairs of nodes.
et
7. Define the chromatic number of a graph.
8. Draw a graph with a cycle but with no Hamiltonian cycle.
9. Define a strongly connected digraph and give the minimum in degree of all the
cs
11. (a) Write the recursive and non-recursive versions of the factorial function.
Examine how much time each function requires as ‘n’ becomes large.
Or
ww
www.csetube.in
www.csetube.in
in
14. (a) Using backtracking, find the optimal solution to a knapsack problem for
the knapsack instance n = 8, m = 110, (p1, p2. ... p7) = (11, 21, 31, 33, 43,
53, 55, 65) and (w1, w2,...,w7) = (1, 11, 21, 33, 43, 53, 55, 65).
e.
Or
(b) Write an algorithm for N QUEENS Problem and Trace it for n=6.
15. (a) Write the Kruskal’s algorithm apply it to find a minimum spanning tree
for the following graph :
Or
ub
(b) Write short notes on NP-hard and NP-completeness.
et
cs
w.
ww
www.csetube.in