Model Question Papers
Model Question Papers
No:
1. Write down the definition of data structures? 2. Give few examples for data structures?
2. State any 2 applications of stack and queue
3. What is an expression tree?
4. What are the two methods of binary tree implementation?
5. What is linear probing?
6. What do you mean by disjoint set?
7. Define (i)indegree (ii)outdegree
8. Write down the adjacency matrix of the graph
11a i) Write down the insertion and deletion algorithm for circular queue. (8)
(or)
11b i) How do you delete a node from a linked linear list. (6)
ii) Define traversal. What are the various traversal that are permitted for a binary tree? Write
down their recursive algorithm and apply to the following example given.(12)
B D
C G
E
(or)
12 b i ) Do the following insertions with the explanation of rotation involved in each insertion in AVL
tree --insert K ,insert M ,insert U,insert T,insert V, insert P(8)
ii) Construct an expression tree for the following expression abc*+de*f+g*+(8)
(or)
13 b ) Construct the hash table with the table size of 13 for the following values 39,48,61,74,87,100,113.
Implement using open addressing and separate chaining with appropriate algorithms. (16)
14 a ) Write down the algorithms for a depth first search and breadth first search and apply to the
following example given. (16)
A B C
D E
G H I
(or)
14 b) Formulate an algorithm to find the shortest path using Dijkstra’s algorithm. (16)
Reg.No:
(or)
11b) Discuss the Doubly linked list and algorithm for the operations that can be performed on
them in detail. (16)
ii) Discuss about the sequential and other representation of trees. (6)
(or)
12b i) construct a heap for the initial key set given the list 42, 23, 74, 11, 65, 58, 94, 36, 99 and
87. (8)
ii) Give one implementation of a priority queue and explain the routines used. (8)
ii) Write a pseudo algorithm for find and union operations. (8)
(or)
13b) Explain the smart union and path compression method with the help of suitable examples.
(16)
14a ) Write a routine to find a shortest path between two given vertices in a weighted directed
graph. Use it to find the shortest path between A and F in the graph of question 14 b) (16)
(or)
14b ) Write a routine to find a minimum spanning tree of a weighted directed graph. Use it to
find the MST of the following graph.(16)
D
5 B 4 2
A F
8 6 6 3
C E
1
15 a ) How Divide and conquer strategy is applicable to Binary Search. Explain (16)
(or)
Reg.No:
11a i) Given two lists L1 and L2. Write the routines to compute L1∩L2 using basic operations.
(Hint: for efficient performance, sort the lists. (10)
ii) Write the routines for inserting and deleting elements from a queue. Check for the
conditions Q-empty and Q- full. (6)
(or)
11bi) With an example, explain infix to postfix conversion and infix to prefix algorithms. (10)
ii) Describe in detail the array implementation of list(6)
12a i) Write the routines to insert and remove a node from Binary Search Tree. (10)
ii) A full node is a node with two children. Prove that the number of full nodes plus one is
equal to the number of leaves in a binary tree. (6)
(or)
12b i) Show the result of inserting 2, 1, 4, 5, 9, 3, 6, 7 into an empty AVL tree. (6)
function
(or)
13b) How will you resolve the collisions while inserting elements into the hash table using
separate chaining and linear probing? Write the routines for inserting, searching and removing
elements from the hash table using the above mentioned techniques.
14a i) Discuss and write the program to perform topological sorting. (6)
ii) What is single source shortest path problem? Discuss Dijkstra’s single source shortest
path algorithm with an example. (10)
(or)
14 b i) Write an algorithm to find the minimum cost spanning tree of an undirected, weighted
graph. (8)
ii) Find MST for the following graph.
2 D
A
7 1
1 3
C F
8 4
B
5
E
6