CSC314 Design and Analysis of Algorithms

Design and Analysis of Algorithms TU Board 2081 question paper

12 questionsSit this paper (timed)

Tribhuvan University

Bachelor of Science in Computer Science and Information Technology

Semester 5 · TU Board 2081

Course Title: Design and Analysis of Algorithms (CSC314)

Full Marks: 60Pass Marks: 24Time: 3 hours

Candidates are required to give their answers in their own words as far as practicable. The figures in the margin indicate full marks.

Group A

Attempt any TWO questions.(2 × 10 = 20)

  1. 1.

    Differentiate between dynamic programming and memorization. Compute the shortest path between every pairs in the following graphs using Floyd Warshal algorithm.

    [figure in the original paper]

    10
  2. 2.

    What is the worst case of quick sort and how does randomize quick sort handle this problem? Sort the data { -2, 4, -3, 6, 12, 10, 11, 13, 9 } using quick sort.

    10
  3. 3.

    Does greedy algorithm guarantee optimal solution? Solve the Fractional knapsack problem to find maximum loot from given information.

    Item
    1
    2
    3
    4
    5
    6
    7
    Value
    12
    10
    20
    15
    2
    3
    50
    Weight (kgs)
    2
    1
    3
    2
    12
    10
    1

    10

Group B

Attempt any EIGHT questions.(8 × 5 = 40)

  1. 4.

    Given a set A=(5,7,10,12,15,18,20}, find the subset that sum to 35 using backtracking.

    5
  2. 5.

    Solve the following recurrence relations using master's method.

    (a)

    (b)

    5
  3. 6.

    Write an algorithm to find the n^th fibonacci number with its time and space complexity.

    5
  4. 7.

    Define order statistics problem. Find the edit distance between "cat" and "car" using dynamic programming.

    5
  5. 8.

    Discuss about recursion and backtracking. Analyze the complexity of Miller Rabin Randomized Primality test.

    5
  6. 9.

    Solve the following linear equation using Chinese Remainder Theorem.

    x = 1 MOD 3

    x = 2 MOD 5

    x = 0 MOD 7

    5
  7. 10.

    Explain the approximation algorithm for vertex cover of a connected graph with an example.

    5
  8. 11.

    State cooks theorem. Discuss about problem reducibility.

    5
  9. 12.

    Write short notes on:

    • a) Big Oh, Big Omega, Big theta

    • b) Class P, Class NP and NP-Complete

    5

— The End —