MCS0212010d.pdf
MCS021  2013 d.PDF
MCS0212014j.PDF
MCS0212014d.PDF
MCS0212013J.pdf
MCS0212012j.pdf
MCS0212012 D.pdf
MCS0212011j.pdf
MCS0212011d.pdf
MCS0212010j.pdf
No. of Printed Pages : 2
MCA (Revised)
TermEnd Examination
December, 2013
MCS021
MCS021 : DATA AND FILE STRUCTURES
_{T}_{i}_{m}_{e} _{:} _{3} _{h}_{o}_{u}_{r}_{s}
Maximum Marks : 100 (Weightage 75%)
Question number 1 is Compulsory. Attempt any three questions from the rest. All algorithms should be written
nearer to 'C' language.
Note :
1.
(a) Write an algorithms for the insertion and 10 deletion operations on the circular queue.
(b) 
Write a procedure to create, insert and 10 display the content of a doubly linked list 
(c) 
Explain "Depth First Search" Algorithm 10 with an example. 
(d) 
What is the need for external sorting ? 10 Explain any one method to perform external sorting. 
2.
3.
(a) Is it possible to implement multiple stocks 10 using a Single Dimensional Array ? Justify your answer. (b) Write an algorithm for sorting whose 10 average and best time complexities are same.
(a) Create a binary search tree for following numbers start from empty BST 45, 26, 10, 60, 70, 30, 40.
_{1}_{0}
MCS021
1
_{P}_{.}_{T}_{.}_{O}_{.}
(b) Write Prim's algorithm for constructing Minimum Cost Spanning Tree and trace the algorithm for the following graph.
_{4}_{.} (a) Define the following term with an example : AVL trees.
_{1}_{0}
10
(b) Explain the process of converting any Tree 10 into a Binary Tree.
5. (a) Write an algorithm for the addition of two 10 matrices using Single Dimensional Arrays.
(b) Propose a representation for a polynomial. Explain the advantages of such representation.
10
MCS021
2
No. of Printed Pages : 2 ^{}
MCS021
MCA (Revised) / BCA (Revised)
TermEnd Examination
June, 2014
MCS021 : DATA AND FILE STRUCTURES
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) Prove by induction that
10
(i) 
The number of leaves in a binary tree of height 'h' are less than or equal to 
2h. 

(ii) 
The number of nodes in a full binary 
tree of height 'h' are equal to (2h+1 _ 1).
(b) 
Write an algorithm to implement Doubly 10 Linked List. 
(c) 
Compare Heap sort and Quick sort with 10 each other. 
(d) 
Write an algorithm for addition of two 10 Sparse Matrices. 
2.
(a) Write an algorithm for insertion sort. Write 10 step by step working of the algorithm for the following set of data. 43, 16, 11, 89, 32, 46, 1, 88 (b) What is a splay tree ? Write the steps 10 involved in a topdown splaying procedure.
MCS021
1
P.T.O.
_{3}_{.}
(a) How is a circular queue better than a linear 10 queue ? Also, write functions for adding and removing an element from the circular queue.
(b)
Write an algorithm for implementing a 10 singly linked list using arrays.
_{4}_{.} Write prim's algorithm for constructing a 10 minimum cost spanning tree and trace the algorithm on the following network.
(a)
(b)
Discuss the various file organisation ^{} methods. Also, list the advantages and disadvantages of each.
10
_{5}_{.} Explain the depth first search algorithm 10 with an example.
What are RedBlack Trees ? What is their 10 significance ?
(a)
(b)
MCS021
2
No. of Printed Pages : 3
MCS021
MCA (Revised) / BCA (Revised) TermEnd Examination
December, 2014
MCS021 : DATA AND FILE STRUCTURES
Maximum Marks : 100 (Weightage 75%)
Note : Question number 1 is _{c}_{o}_{m}_{p}_{u}_{l}_{s}_{o}_{r}_{y}_{.} _{A}_{t}_{t}_{e}_{m}_{p}_{t} _{a}_{n}_{y} three questions from the rest. All algorithms should be written nearer to 'C' language.
Time : 3 hours
1. (a) Consider the algorithm given below : ^{}
_{1}_{0}
(i) 
scanf ("%d", &n); 
(ii) 
{for (int i = n; < = n * n; i = n + 10) 
(iii) 
(for (int j = 1; j < = n; j++) 
(iv) 
printf ("%d", n/i + j);}} 
Calculate the complexity (both space and time) of the above code by using Big "0" notation.
(b) 
Define sparse matrix. Write an algorithm that accepts a 6 x 5 sparse matrix and outputs in 3tuple representation. ^{} _{1}_{0} 

(c) 
Write an algorithm for Heapsort. Write step by step working of algorithm for the following set of data : ^{} 
_{1}_{0} 
9, 16, 43, 27, 91, 33, 21, 7, 3
MCS021
_{1} _{}
_{P}_{.}_{T}_{.}_{O}_{.}
(d) Draw AVL tree by inserting the following elements one by one : ^{} 7, 13, 27, 9, 11, 14, 8, 37, 24 
10 
_{2}_{.} (a) Write FloydWarshall's algorithm for 

computing "All pair shortest path" problem. 

Show how does your algorithm work for the 

following graph : ^{} 
10 
(b) Write an algorithm for inserting a node in 

a RedBlack tree. Write step by step 

working of algorithm using an example. 
10 
_{3}_{.} (a) Write an algorithm for adding two 

polynomials. Algorithm should take the two 

polynomials as input and display the 

resultant polynomial. 
10 
(b) Write an algorithm for array implementation of a circular queue. 
10 
MCS021
2
P.T.O.
_{4}_{.} (a) Write an algorithm to insert and delete a node from a doublylinked list. ^{}
(b) Write an algorithm to insert an element into a Btree. Make Btree using your algorithm for the following list of elements : ^{}
10
10
22, 29, 8, 34, 17, 89, 11, 19
_{5}_{.} (a) Compare any two file organisations.
(b) What is a BST ? Explain with an example. What are its limitations ?
10
10
MCS021
3
13,500
No. of Printed Pages : 2
^{C}^{.}^{N}
MCA (Revised)
TermEnd Examination June, 2013
MCS021
MCS021 : DATA AND FILE STRUCTURES
Maximum Marks : 100 (Weightage 75%)
Note : Question number 1 is Compulsory. Attempt any three questions from the rest. All algorithms should be written
_{T}_{i}_{m}_{e} _{:} _{3} _{h}_{o}_{u}_{r}_{s} _{}
1.
2.
_{n}_{e}_{a}_{r}_{e}_{r} _{t}_{o} 'C' language.
(a)
_{(}_{b}_{)}
(c)
(d)
Design algorithms for various operations performed on circularly linked list.
_{1}_{0}
What are the advantages of using lists than 10 arrays while implementing a stack ? Explain.
Write a procedure to find minimum cost 10 spanning tree for a graph using Prim's algorithm.
Explain the process of creating a Splay Tree using an example.
_{1}_{0}
(a) Write a procedure to create, insert and
10
display the content of a singly linked list.
3.
10
(b) Propose any two representations for Sparse Matrices and compare them.
(a) Write a procedure to create, insert and 10 delete an element in queue.
MCS021
1
P.T.O.
(b) Explain the allpairs shortest path problems 10 with algorithm and trace the algorithm for the following digraph :
_{4}_{.} (a) Write a procedure to sort the following sequence : 25 57 48 37 12 92 86 33. Use Heap Sort.
10
(b) Write the algorithms for each of the 10 following for binary trees :
_{(}_{i}_{)} _{} Inorder traversal Preorder traversal Postorder traversal
_{5}_{.} (a) Enumerate different file organizations. 10 Explain any two file organizations with examples. _{(}_{b}_{)} _{D}_{i}_{s}_{c}_{u}_{s}_{s} _{a}_{n}_{y} two applications of redblack 1 0 trees in detail.
MCS021
2
No. of Printed Pages : 3
_{M}_{C}_{S}_{}_{0}_{2}_{1}
^{r}^{}^{}
O
O
MCA (Revised)
TermEnd Examination
June, 2012
MCS021 : DATA AND FILE STRUCTURES
Time : 3 hours
Note :
Maximum Marks : 100 (Weightage _{7}_{5}_{%}_{)}
Question number 1 is Compulsory. Attempt any three questions from the rest. All algorithms should be written nearer to C language.
1.
(a) What are the pre conditions for applying binary search on any list containing Integer values ? Write the algorithm and manually run it on the following list of number :
10 27 2.356 38 66 45
_{1}_{0}
What is worst case complexity of the above algorithm ?
(b) Differentiate between AA trees and Red  Black frees ? Construct an AA  Tree using the following nodes. Show all intermediate steps and balancing of tree. °
_{1}_{0}
17, 4, 25, 98, 28, 33, 42, 11, 6, 73
MCS021
1
_{P}_{.}_{T}_{.}_{O}_{.}
(c)
Consider the following matrix :
5 
6 
21 

X= 
8 
2 
4 
_{1} 
_{3} 
6 3x3 
Write the steps involved in calculating the rank of X.
Write an algorithm to find the transpose of X.
(d) Write an algorithm that sort a given linked list of integers. Also, write a function that splits this linked list into a linked list of even integers and a linked list of odd integers.
_{(}_{i}_{)} _{}
_{2}_{.} (a) Construct a binary tree using the following pre  order and in  order trasversals :
5
5
10
10
Preorder:ABGHMCDEF
Inorder:BHMGADFEC
(b) Write an algorithm for multiplication of two sparse matrices.
_{3}_{.} (a) Explain the shell sorting technique with an example. Give the complexity of above technique in terms of comparisions and storage required for both best and worst cases.
MCS021
10
10
(b) 
Write the functions to perform Push and Pop operations of stack using pointers. Using above functions, write an algorithm to convert a given infix notation to its equivalent postfix notation. 
_{1}_{0} 
4. Write an algorithm to find the frequency _{1}_{0} (occurance of words) from a give text tile. The list of words and their corresponding frequency should be in the alphabetical order of words. (a) 
(b) Explain the different types of file organisations available. Also, explain one advantage and one disadvantage of each.
_{1}_{0}
5. Using Dijkstra's algorithm, find the shortest 10 path between A and F for the following graph. Show the intermediate steps also.
(a)
B
(b)
E
Write short notes on the following with an
example :
(i) 
AVL tree 
(ii) 
Circular Queue 
_{5}_{x}_{2}_{=}_{1}_{0}
MCS021
_{3}
Lc) _{}
71. O
O
No. of Printed Pages : 3 ^{}
MCS021
MCA (Revised)
_{T}_{e}_{r}_{m}_{}_{E}_{n}_{d} Examination
December, 2012
MCS021 : DATA AND FILE STRUCTURES
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.
_{T}_{i}_{m}_{e} _{:} _{3} _{h}_{o}_{u}_{r}_{s} _{}
1.
(a) Prove by Induction that :
_{(}_{i}_{)} 
The number of leaves in a binary tree 
of height "h" is less than or equal to 

211. 

_{(}_{i}_{i}_{)} 
The number of nodes in full binary tree 
of height is equal to 2h+1  1.
5
5
_{(}_{b}_{)} 
Show stepbystep construction of a BTree 10 (t=3) resulting from the insertion of the following keys. A, S, T, M, U, K, L, B, G, N Also, show deletion of Key 'U' and 'K' from 
the BTree constructed above. 

_{(}_{c}_{)} 
Write an algorithm to sort "N" numbers 10 using Bubble sort. Also, show that bubble sort algorithm, on average, makes 0(N2) comparisions while sorting a list of N elements. 
MCS021
1
P.T.O.
(d)
What is a heightbalanced tree ? Construct an AVL tree for the following elements :
10
6, 3, 15, 24, 7, 89, 12, 34, 2 Show all intermediate steps.
2. (a) What is a Dequeue ? Write an algorithm to insert and delete the node in a Dequeue. 
10 

(b) 
Write an algorithm to implement Heap using linked list. The algorithm should clearly perform PUSH and POP operation. 
10 
3. (a) Write recursive algorithm for preorder, 
10 

inorder and post order traversal of a Binary tree. Also, give an example to show the traversals. (b) Construct a RedBlack tree from the following set of data items. 11, 9, 7, 27, 8, 100, 22, 92 Also, show step  by  step procedure to delete "100" from the constructed tree. 
10 

4. (a) Write an algorithm to reverse the order of nodes in a doubly linked list with header node. 
_{1}_{0} 

(b) 
Differentiate between the Kruskal's and prim's algorithm based on their principle, operation and running time. Also, write any two applications of minimum cost spanning tree. 
_{1}_{0} 
MCS021
2
5. (a) Differentiate between Indexed file 10 organisation and Indexed sequential file organisation. Also, write any four disadvantages of sequential file organisation. (b) Write short notes on the following with an
5x2=10
example of each :
_{(}_{i}_{)} 
Multiple stacks 
(ii) 
AATree 
MCS021
3
No. of Printed Pages : 2
MCS021
_{N}
0
00
0
MCA (Revised)
TermEnd Examination
June, 2011
MCS021 : DATA AND FILE STRUCTURES
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.
_{T}_{i}_{m}_{e} _{:} _{3} _{h}_{o}_{u}_{r}_{s} _{}
1.
(a) Elaborate various asymptotic notations used 10 to evaluate the efficiency of the algorithm.
Explain in detail the push and pop
_{1}_{0}
operations in a stack.
Explain in brief the AVL tree rotations. _{1}_{0}
Solve the following instance of single source shortest paths problem with vertex 'a' as the source.
_{1}_{0}
(c)
(b)
(d)
MCS021 ^{}
1 ^{}
_{P}_{.}_{T}_{.}_{O}_{.}
2. 
(a) Write a program that accepts two polynomials as input and displays the resultant polynomial diie to the addition of input polynomials. 

(b) 
Explain the recursive algorithm for each of the binary tree traversals. Construct the path for each of above traversals for the following example. 

3. 
(a) Write an algorithm for array implementation of a circular queue. 

(b) 
Explain the concepts of breadth first search with example. 

4. 
(a) Explain in detail the binary search with example. 

(b) 
Describe the Quick sort algorithm. 

5. 
(a) Give an example for various operations of AATrees. 

(b) 
Write a detailed note on file organization techniques. 
10
10
_{1}_{0}
_{1}_{0}
_{1}_{0}
_{1}_{0}
_{1}_{0}
_{1}_{0}
MCS021
2
No. of Printed Pages : _{2}
MCS021 I
MCA (Revised) TermEnd Examination
December, 2011
^{t}^{r}^{)}
_{k}_{n}
C
CD MCS021 : DATA AND FILE STRUCTURES
Time : 3 hours
Note :
Maximum Marks : _{1}_{0}_{0} (Weigh tage 75%)
Question number 1 is _{C}_{o}_{m}_{p}_{u}_{l}_{s}_{o}_{r}_{y}_{.} _{A}_{t}_{t}_{e}_{m}_{p}_{t} _{a}_{n}_{y} _{t}_{h}_{r}_{e}_{e} questions from the rest. All algorithms should be written nearer to C language.
1. (a) Write an algorithm for implementing _{1}_{0} insertion and deletion operations in a singly linked list using arrays.
(b) 
What are the various operations in a _{1}_{0} queue ? Explain each of them. 

(c) 
Write prim's algorithm for constructing a _{1}_{0} minimum cost spanning tree and trace the algorithm on the following network. 

(d) 
With relevant example, explain the splaying procedure in detail. 
_{1}_{0} 
MCS  021
_{1}
_{P}_{.}_{T}_{.}_{O}_{.}
2. Describe the relationship between asymptotic notations with a neat sketch.
Explain in detail the algorithmic implementation of multiple stacks.
3. Explain the depth first search algorithm with example.
Write Floyd's algorithm for allpairs shortest path algorithm.
(a)
(b)
(a)
(b)
4. Discuss about the linear search in detail.
(a)
(b)
Apply heap sort for the following unordered elements
2, 3, 81, 64, 4, 25, 36, 16, 9, 49,
_{1}_{0}
_{1}_{0}
_{1}_{0}
_{1}_{0}
_{1}_{0}
_{1}_{0}
5. Explain the operations of RedBlack Trees. _{1}_{0}
10
(a)
(b)
Write a detailed note on sequential file organization.
MCS021
_{2}
No. of Printed Pages : 3
_{I} _{M}_{C}_{S}_{}_{0}_{2}_{1} _{I}
MCA (Revised)
cV TermEnd Examination
•14
"1"
O
June, 2010
_{M}_{C}_{S}_{}_{0}_{2}_{1} : DATA AND FILE STRUCTURES
Maximum Marks : 100 (Weightage 75%)
_{N}_{o}_{t}_{e} _{:} _{Q}_{u}_{e}_{s}_{t}_{i}_{o}_{n} _{n}_{u}_{m}_{b}_{e}_{r} _{1} _{i}_{s} Compulsory. Attempt any three questions from the rest. All algorithms should be written nearer to C language.
_{T}_{i}_{m}_{e} _{:} _{3} _{h}_{o}_{u}_{r}_{s}
1. 
(a) Write a program to store the roll numbers 
_{1}_{5} 
and names of students in a binary search tree. Write a function to accept a number and display the name of the student, whose roll number matches with this number. Give suitable messages if the roll number does not exist in the binary search tree. (b) Consider the algorithm given below : 
_{1}_{0} 
_{S}_{c}_{a}_{n}_{f} ("%d"; & max); {for (int i =1; i< = max; i + + ){ for (int j =1; j<= max; j + + ) Printf ("%d", i * j); Calculate the complexity (both space and time) of the above code by using Big '0' notation.
MCS021
1
P.T.O.
Write a program to simulate a circular queue using pointers with functions for insertion, deletion. (Use singly linked list). 
_{1}_{0} 
Write an algorithm for pushing an element into a stack. 
_{5} 
(a) 
Write a program to find the frequency of _{1}_{5} words in a given text. The list of words and their corresponding frequency should be in the alphabetical order of words. 

(b) 
Explain the properties and operations of AA trees. 
_{5} 
(a) What is a sparse matrix ? What is its 3tuple _{1}_{0} representation ? Also, write an algorithm that accepts 5x4 sparse matrix and outputs its 3 tuple representation.
(b) Find minimum cost spanning tree from the _{1}_{0} following graph using Prim's Algorithm.
MCS021
_{2}
(a) 
Show step by step construction of an AVL 10 tree resulting from the inserting of the following sequence of keys. 
10, 3, 18, 4, 6, 8, 16, 14 

Now, Delete key "8" from the constructed AVL tree and show the resultant tree. 

(b) 
What are the essential features of a binary _{1}_{0} tree ? Explain, how a general tree can be converted into a binary tree ? 
(a) 
Preorder traversal of a certain binary tree _{1}_{0} produces 
ADFGHKLPQRWZ 

and in order traversal produces : 

GFHKDLAWRQPZ 

Using Preorder and inorder traversal, draw the corresponding binary tree. 

(b) 
Write an algorithm to balance a RedBlack _{1}_{0} tree after deleting a node. 
Mult mai mult decât documente.
Descoperiți tot ce are Scribd de oferit, inclusiv cărți și cărți audio de la editori majori.
Anulați oricând.