# 2005 Indira Gandhi National Open University IGNOU M C A MCS 021 DATA AND FILE STRUCTURES Question paper

** University Question Papers **

**
**2005 Indira Gandhi National Open University IGNOU M C A MCS 021 DATA AND FILE STRUCTURES Question paper

MCS-021 : DATA AND FILE STRUCTURES

December, 2005

Time: 3 hours

Maximum Marks: 100

(Weightage 75%)

Note : Question number 1 is compulsory. Attempt any three questions from the rest. All algorithms should be written nearer to 'C' language.

1. (a) Write an algorithm for the addition of two polynomials in one variable. (10)

(b) Define a stack. Explain the operations that can be performed on a stack. How are multiple stack implemented using arrays ? (10)

(c) Define and give an example of a Minimum Cost Spanning Tree. Write at least two differences between Kruskal's and Prim's Algorithms. (10)

(d) Define a heap. Sort the following numbers using Heap Sort : (10)

2, 3, 81, 64, 4, 25, 36, 16, 9, 49

Clearly write all the steps involved in sorting the numbers.

2. (a) Give simplified big-O notation for the following functions : (5)

(i) 30 n2

(ii) log n+3n

(b) Define dequeue. Wnte an algorithm for the implementation of a dequeue using arrays. (15)

3. (a) Define a tree, and a binary tree. What are the different ways of traversing a binary tree ? Write an algorithm for any one of the traversal methods. (14)

(b) Write an algorithm for the implementation of Binary Search. What are its Space and Time complexities ? (6)

4. (a) Define an AVL tree. In case an AVL tree becomes unbalanced, how will you balance it ? Explain with example(s). (15)

(b) Explain an indexed Sequential File Organisation. (5)

5. (a) Define a Splay tree. Explain the possible splay rotations. (10)

(b) Write an algorithm for the implementation of a Singly Linked List. (10)