Tribhuwan University

Institute of Science and Technology

2081

Bachelor Level / Second Year / Third Semester / Science

B.Sc in Computer Science and Information Technology (CSC211)

(Data Structures and Algorithms)

Full Marks: 60

Pass Marks: 24

Time: 3 Hours

Candidates are required to give their answers in their own words as for as practicable.

The figures in the margin indicate full marks.

Section A

Long Answers Questions

Attempt any TWO questions.
[2*10=20]
1.
What is AVL tree? How heap differ from tree? Construct an AVL tree for data 24,12,8,15,35,30,57,40,45 and 78.[10]
2.
Define list. How can you use linked list to implement stack? Explain circular linked list.[10]
3.
Define circular queue. How queue differ from stack. Write a program to implement linear queue.[10]
Section B

Short Answers Questions

Attempt any Eight questions.
[8*5=40]
4.
Convert the infix expression A+(((B-C)*(D-E)+F)/G$(H-I) into post expression using stack. [5]
5.
Write a program to find GCD of two numbers using recursion. [5]
6.
What is the application of spanning tree? Draw a MST of a graph containing any 8 vertices and 11 edges with arbitrary edge costs. [5]
7.
Sort the number {82, 73, 12, 39, 26, 88, 2, 9, 60, 41} using shell sort. [5]
8.
What is hashing? how do you apply linear probing and rehashing explain with example. [5]
9.
What is the algorithm for node insertion and deletion from specified position from doubly linked list. [5]
10.
Explain big oh notation in brief. Find big oh of the following function: $f(x) = 5x^4 + 9x^2 + 7x + 9$. [5]
11.
What is linear queue? Why do we need circular queue? Explain. [5]
12.
Write short notes on: a. Breadth First traversal of graph b. TOH [5]