Bsc Csit Nepal

2075

Data Structures and Algorithms

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

Attempt any two questions: (2 x 10 = 20)

  1. How can you use stack to convert an infix expression to postfix? Convert infix expression (A+B)*(C-D) to postfix using stack. (4+6)
  2. Explain concept of divide and conquer algorithm. Hand test quick sort algorithm with array of numbers (78, 34, 21, 43, 77, 18, 9, 56, 38, 19). What is time complexity of quick sort algorithm? (3+7)
  3. Discuss depth first and breadth first traversal of a graph with suitable example. (5+5)

Attempt any eight questions: (8 x 5 = 40)

  1. What do you mean by complexity of algorithm? How do you find time complexity? (2+3)
  2. Compare stack with queue. How is linear queue different from circular queue? (2+3)
  3. What is ADT? Discuss stack as an ADT. (1+4)
  4. Define recursive algorithm? How do you implement recursive algorithm while writing computer programs? (2+3)
  5. What are benifits of using linked list over array? How can you insert a node in a singly linked list? (2+3)
  6. How do you implement binary search algorithm? What is time complexity of this algorithm? (4+1)
  7. What is hashing? Discuss rehashing with example (1.5+3.5)
  8. How do you traverse a binary tree? Discuss. (5)
  9. Write short notes on: (2.5+2.5)
    • a. Dynamic memory allocation
    • b. Game tree