Vous êtes sur la page 1sur 2

Enrollment Number____________ Amrita Vishwa Vidyapeetham Amrita School of Engineering, Amritapuri B.Sc.

(Computer Science), Contact Course Second Internal Examination, October 2009 CST222 Algorithms Time: 2 Hours Max. Marks: 50

1. Write any two applications Depth First Search.

(2 marks)

2. Compare the complexity of Kruskals algorithm and Prims algorithm for dense and spare graph. Which of the two is efficient in each condition? (2 marks) 3. Explain the general characteristics of Greedy algorithm. 4. Explain how the divide-and-conquer strategy is applied Binary Search algorithm (4 marks) (4 marks)

5. Write Prims algorithm and how this algorithm can be applied to the below graph to find minimum cost spanning tree. Draw the minimum cost spanning tree and give its cost. (5 marks)

6. What is Topological Sorting? For the below graph find the topological ordering of the node. (5 marks)

7. Write a Greedy algorithm to solve the following Knapsack problem and solve the below problem. ( 8 marks) Knapsack Capacity : 100 Item 1 20 25 Item 2 10 30 Item 3 50 15 Item 4 55 10 Item 5 45 15

Value Weight

8. For the following graph, write the algorithm and find the result of applying Depth First Search and Breadth First Search. (10 marks)
A X H E G P M J Y

9. Explain the Divide-and Conquer strategy algorithm and its time complexity. Explain how this can be applied to find the exponentiation of a number. (10 marks)

Vous aimerez peut-être aussi