M. C. S. E. Examination 2006
(1st Semester)

Time: Three hours Answer any five questions 1 . Write an algorithm to find the kth -smallest element out of n and argue for its efficiency. 20 2. 3. Explain the randomized quicksort algorithm and discuss its efficiency. 20 a) Define the knapsack problem and solve it. b) Explain the job sequencing problem and devise an optimal solution. 10+10 4. What is the principle of optimality? Does it always hold? Formulate a k-stage graph problem as a dynamic programming problem and outline a solution. 5+5+10 5. Explain the 8-Queens problem and provide an efficient backtracking solution. 20 6. Use least cost search for the 15-puzzle problem and state the condition for the solution. 20 7. Write an algorithm for Huffman code and prove its correctness 20 Full Marks: 100

Sign up to vote on this title
UsefulNot useful