Sie sind auf Seite 1von 23

Appendix B - University Question papers

APPENDIX B -UNIVERSITY QUESTION PAPERS

B.E./B.Tech. DEGREE EXAMINATION, MAY/JUNE 2013.


Third semester
Information Technology
IT2201/ IT33/ 10144 IT 304/ 080250005 - DATA STRUCTURES AND ALGORITHMS
(Regulation 2008/2010)
Time : Three hours Maximum : 100 marks
Answer all questions.
PART A-(10*2 = 20 marks)

1. What is abstract data types? Give example.


2. What are the applications of stack and queue?
3. Show that in a binary tree of N nodes, there are N+1 NULL pointer.
4. Show the result of inserting 2; 1; 4; 5; 9; 3; 6; 7 into an initially empty AVL-tree.
5. What is rehashing?
6. Write code for disjoint set find.
7. Does either prim’s or kruskal’s algorithm work if there are negative edge weights?
8. List out the applications of graph.
9. Compare and contrast greedy algorithm and dynamic programming.
10. Draw the solution for the 4-queen problem.

PART B-(5*16 = 80 marks)

11. (a) (i) Explain how stack is used to convert the following infix expression into postfix form
a+b*c+(d*e+f)*g. (8)
(ii) Give the linked list implementation of stack. (8)
Or
(b) Explain and write the routine for insertion, deletion and finding element in then cursor
based linked list. (16)
12. (a) (i) Construct an expression tree for the expression ab+cde+** (10)
(ii) Give a precise expression for the minimum number of nodes in an AVL tree of height
h and what is the minimum number of nodes in an AVL tree of height 15? (6)
Or
(b) (i) Write function to perform delete min in a binary heap. (8)
(ii) Show the result of inserting 3; 1; 4; 6; 9; 2; 5; 7 into an initially empty binary search
tree. (8)
13. (a) Given input {4371,1323,6173,4199,4344,9679,1989} and a hash function h(x)=x mod 10.
Show the resulting: (16)

91
Appendix B - University Question papers

(i) Separate chaining hash table.


(ii) Open addressing hash table using linear probing.
(iii) Open addressing hash table using quadratic probing.
(iv) Open addressing hash table with second hash function h2(x)=7-{x mod 7}.
Or
(b) Give short note on:
(i) Dynamic equivalence problem. (8)
(ii) Smart Union algorithm. (8)
14. (a) (i) Find the shortest weighted path from A to all other vertices for the graph in given
below figure.
(ii) Find the shortest unweighted path from B to all other vertices for the graph in given
below figure. (16)

Or
(b) (i) Write a routine to implement kruskals’ algorithm. (8)
(ii) Discuss in detail about biconnectivity. (8)
15. (a) (i) Explain in detail about branch and bound algorithm design technique with an example.
(10)
(ii) Write a routine for random number generator algorithm. (6)
Or
(b) (i) Explain in detail about asymptotic notations. (6)
(ii) Discuss in detail about NP-complete problem with example. (10)

92
Appendix B - University Question papers

B.E./B.Tech. DEGREE EXAMINATION, MAY/JUNE 2013.


Third semester
Electrical and Electronics Engineering
EE 2204/ EE 36/ 10133 EE 306/ 080300003- DATA STRUCTURES AND ALGORITHMS
(Regulation 2008/2010)
Time : Three hours Maximum : 100 marks
Answer all questions.
PART A-(10*2 = 20 marks)
1. Give an example for abstract data types.
2. Write an algorithm for deleting an element in a queue which is implemented using arrays.
3. Draw the expression tree for (a+b*c)+((d*e+f)*g).
4. Write the pseudo code to insert an element at the end of a linked list.
5. Insert 3, 2, 1, 4, 5, 6, 7, 16, 15 into an empty AVL tree.
6. What is a biconnected graph?
7. Define big O notation.
8. Differentiate NP-and NP-complete problem.
9. Insert the following letters into an empty B-tree of order 5: C N G A H E K Q M F W L T Z.
10. Find the breadth first search for the following instance of a graph.

PART B-(5*16 = 80 marks)


11. (a) (i) Explain the implementation of cursor based linked list with example. (8)
(ii)Write an algorithm to insert and delete a given node from doubly linked list.(8)
Or
(b) (i) Write the algorithm for inorder, preorder and postorder traversal of a tree. (9)
(ii) Draw the binary search tree whose inorder traversal is A, B, C, D, E, F, G, H, I and the
preorder traversal is F, B, A, D, C, E, G, I, H. (7)
12. (a) (i) Write the algorithm for insert and delete operation in BST. (8)
(ii) Insert 17, 21, 13, 15, 10, 16, 4, 24, 27, 23, 11, 25, 26 into an initially empty binary
search tree. Delete 4, 10, 27, and 13 from the tree. (8)
Or
(b) (i) Write Prim’s algorithm to find the minimum spanning tree for a connected weighted
undirected graph. Trace the algorithm for the following graph. (16)

93
Appendix B - University Question papers

Fig.2

13. (a) Write the algorithm to find the shortest path between 2 nodes. Trace the algorithm to find
the minimum distance between node A and G in the graph shown in Fig.2. (16)
Or
(b) Explain the steps involved in Branch and Bound algorithm design technique. Apply this
technique to solve the following instance of knapsack problem. Draw the state space tree.(16)
ITEM PROFIT WEIGHT
0 0 0
1 11 1
2 21 11
3 31 21
4 33 23
5 43 33
6 53 43
7 55 45
8 65 55

14. (a) What is hashing? Explain any two methods of hashing. What is meant by collision
resolution? What are the methods used to resolve collisions?
Or
(b) Explain the principles of dynamic programing. Given a list of words a, am, and, egg, if,
the, two and their corresponding probabilities 0.22, 0.18, 0.20, 0.05, 0.25, 0.02, 0.08 respectively.
Construct an optimal binary search tree. (16)
15. (a) Write an algorithm for basic operations on stack. Formulate an algorithm to check for
balanced parenthesis. (16)
Or
(b) What is max heap? Explain the steps involved in inserting elements into a heap with an
example. Write an algorithm to insert am element into max heap.

94
Appendix B - University Question papers

B.E./B.Tech. DEGREE EXAMINATION, MAY/JUNE 2012.


Third semester
Computer Science and Engineering
CS 2201/141301/CS 33/10144 CS 302/080230007- DATA STRUCTURES
(Regulation 2008)
Time : Three hours Maximum : 100 marks
Answer all questions.
PART A-(10*2 = 20 marks)

1. What are the operations can be done with set ADT?


2. Give any three applications of linked list.
3. Draw the expression tree for ((b+c)*a)+((d+e*f)+g).
4. What are the advantages of threaded binary tree?
5. What are the differences between binary search tree and AVL tree?
6. What is the purpose of splay tree?
7. What is meant by open addressing?
8. What is the purpose of dynamic hashing?
9. Define critical path.
10. What is weakly connected graph?

PART B-(5*16 = 80 marks)

11. (a) (i) Explain the operations of queue with C function. (8)
(ii) Explain the array implementation of stacks. (8)
Or
(b) Explain the cursor implementation of linked list. (16)
12. (a) Explain the traversals of binary tree with examples. (16)
Or
(b) Describe the operations of binary search tree with functions. (16)
13. (a) Briefly explain the single rotation and double rotation of AVL tree with examples. (16)
Or
(b) Explain the binary heap operations with examples. (16)
14. (a) For the given input (4371,1323,6173,4199,4344,9679,1989) and a hash function n(X) = X
mod 10. Show the resulting:
(i) Seperate chaining hash table.
(ii) Open addressing hash table using linear probing.
(iii) Open addressing hash table using quadratic probing.
(iv) Open addressing hash table with second hash function. h2(X)=7-(X mod 7). (16)
Or

95
Appendix B - University Question papers

(b) Explain the smart union algorithm with example. (16)


15. (a) (i) Explain the prims algorithm with example. (8)
(ii) Explain topological sort with an example. (8)
Or
(b) (i) Explain the kruskals algorithm with example. (8)
(ii) Explain the Dijikstras algorithm with an example. (8)

96
Appendix B - University Question papers

B.E./B.Tech. DEGREE EXAMINATION, NOV/DEC 2012.


Third semester
Information Technology
IT2201/ IT33/ 10144 IT 304/ 080250005 - DATA STRUCTURES AND ALGORITHMS
(Regulation 2008)
Time : Three hours Maximum : 100 marks
Answer all questions.
PART A-(10*2 = 20 marks)

1. What is a data structures? How is it classified?


2. Define stack as a data structures and discuss its applications.
3. List some applications of tree data structures.
4. Give example for min and max binary heap trees.
5. What do you mean by hashing? Mention any one hash function.
6. State the properties of equivalence relations.
7. What is meant by indegree and outdegree of a vertex?
8. What is meant by articulation points?
9. What are asymptotic notations and basic efficiency classes?
10. Define NP completeness.

PART B-(5*16 = 80 marks)

11. (a) (i) What are Circular Queues? Write an ADT for c Circular Queue to perform insertion
and deletion operations. (10)
(ii) Write the deletion routine for cursor implementation of linked lists. (6)
Or
(b) (i) Write an algorithm to insert a node in the beginning and in the end of the linked list.(8)
(ii) Write an algorithm to evaluate a postfix expression. Execute your algorithm using the
following postfix expression as your input: ab+cd+*f↑ (8)
12. (a) (i) Formulate an ADT to insert and delete a node in a binary search tree. (8)
(ii) What are expression trees? Represent the following expression using a tree: (a-b)/
((c*d)+e. Comment on the result that you get when is traversed in preorder, inorder and
postorder. (1+1+6)
Or
(b) (i) Construct an AVL tree with values F, S, Q, K, C, L, H, T, V, W, M, R into an initially
empty tree. Write an algorithm for inserting into an AVL tree. (10)
(ii) Write a note on general trees with an example. (6)
13. (a) (i) The following values are to be sorted in a hash table.
25, 42, 96, 101, 102, 162, 197

97
Appendix B - University Question papers

Describe how the values are hashed by using division method of hashing with a table size of 7.
Use hashing as the method of collision resolution. (8)
(ii) What are the types of collision resolution techniques and the methods used in each of
the type? Explain the different types of collision resolution techniques. (8)
Or
(b) Explain with code, the union operations hat are performed: (4×4=16)
(i) Arbitrarily
(ii) Union by size
(iii) Union by height
(iv) Find with path compression.
14. (a) (i) Which are the two standard ways of traversing a graph? Explain each with an example.

(10)
(ii) What is minimum spanning tree? Execute Kruskal’s algorithm to find the minimum
spanning tree for a graph. (6)
Or
(b) (i) Explain Dijkstra’s algorithm for finding the shortest path in a graph. (10)
(ii) Consider the following specification of a graph G.
V(G)= {1, 2, 3, 4}
E(G) = {(1,2), (1,3), (3,3), (3,4), (4,1)}
(1) Draw an undirected graph.
(2) Draw its adjacency matrix. (6)
15. (a) (i) Explain how the Divide and Conquer technique is applied in Merge Sort. (8)
(ii) What does dynamic programming have in common with divide and conquer. Describe
about it. (6)
Or
(b) (i) Explain greedy algorithm for the change making problem. (10)
(ii) Describe about randomized algorithms. (6)

98
Appendix B - University Question papers

B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER 2011.


Third Semester
Electrical and Electronics Engineering
EE 2204 — DATA STRUCTURES AND ALGORITHMS
(Common to E& I and Instrumentation & Control Engineering)
(Regulation 2008)
Answer ALL questions.
PART A — (10 × 2 = 20 marks)
1. What is Abstract data type?
2. List any two applications of queue.
3. Define nonlinear data structure.
4. Define complete binary tree.
5. Define AVL trees.
6. Define load factor of a hash table.
7. What is a forest?
8. Define Biconnectivity.
9. List any two applications that use greedy algorithm.
10. Define Skip Lists.
PART B — (5 × 16 = 80 marks)
11. (a) (i) Explain in detail the linked stack and linked queue.
(ii) Given two sorted lists, L1 and L2, write procedure to compute L1 U L2 and L1 using only
the basic list operations.
Or
(b) What is a doubly linked list? Write an algorithm for inserting and deleting an element from
Doubly linked list.
12.(a) How do you represent binary tree in a list? Write an algorithm for finding Kth element and
deleting an element.
Or
(b) Construct an expression tree for the following expression (a + b*c)+(d*e + f)*g.
13. (a) Write the functions to insert and delete elements from the AVL tree.
Or
(b) What is meant by open addressing? Explain the collusion resolution strategies in detail.
14. (a) Compare Prim’s algorithm with Kruskal’s algorithm.
Or
(b) List any two applications of DFS. Explain in detail.
15. (a) State the running time equation theorem of divide and conquer algorithms and prove it.
Or
(b) Prove that the travelling salesman problem is NP complete.

99
Appendix B - University Question papers

B.E./B.Tech. DEGREE EXAMINATION, APRIL/MAY 2011


Third Semester Electrical and Electronics Engineering
EE 2204 — DATA STRUCTURES AND ALGORITHMS
(Regulation 2008) Time : Three hours Maximum : 100 marks
Answer ALL questions
PART A — (10 × 2 = 20 mark)

1. Define stack. What are the operations performed on a stack?


2. Mention the applications of list.
3. Define tree. List the tree traversal techniques.
4. Differentiate a binary tree from a binary search tree.
5. What is meant by binary heaps?
6. What is linear hashing? Specify its merits and demerits.
7. What is meant by digraph? Define the terms in-degree and out-degree with respect to a
digraph.
8. Write the adjacency matrix for the following graph.
9. What is dynamic programming? Give two examples.
10. What is meant by NP-complete problem?
PART B — (5 × 16 = 80 marks)
11. (a) What is doubly linked list? Explain the algorithm in detail for inserting a node to the left
and deleting a node from a doubly linked list. (16)
Or
(b) Write an algorithm and explain how insertions and deletions are carried out in a circular
queue implemented using linked list. (16)

12. (a) (i) Discuss how a node could be inserted in a binary tree? (8)
(ii) Write a procedure in C to find the Kth element in binary tree. (8)
Or
(b) (i) Derive the expression tree for the expression (a + b + c) + ((d ∗e + f ) ∗ g ) . Briefly
explain the construction procedure for the above. (6)
(ii) Write routines to implement the basic binary search tree operations. (10)

13. (a) Explain with algorithm how insertion and deletion is performed in a AVL tree. Explain
how the tree is balanced after the operation. (16)
Or
(b) (i) Write a procedure in C that will traverse a linked B-tree, visiting all its entries in order of
keys (smaller to larger). (10)
(ii) What is meant by collision in hashing? Explain the separate chaining collision resolution

100
Appendix B - University Question papers

strategy. (6)

14. (a) (i) Define Graph. Briefly explain the graph traversal algorithms with an example.
(8)
(ii) Find the shortest path from node 1 to 7 using shortest path algorithm. (8)
Or
(b) With an example, explain Kruskal’s algorithm for finding minimum spanning tree.
(16)
15. (a) (i) Develop an algorithm for binary search using divide and conquer method. Analyze its
time and space complexity. (8)
(ii) Write a greedy algorithm to solve job sequencing with deadline problem. (8)
Or
(b) (i) Explain any one algorithm to solve bin packing problem. (6)
(ii) Explain backtracking algorithm design technique with an example. (10)

101
Appendix B - University Question papers

B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER 2010


Third Semester
Computer Science and Engineering
CS 2201 — DATA STRUCTURES
(Regulation 2008)
Answer ALL questions
PART A — (10 × 2 = 20 Marks)
1. What is an Abstract Data Type? What are all not concerned in an ADT?
2. Explain why binary search cannot be performed on a linked list.
3. Number the following binary tree (Fig. 1) to traverse it in.
(a) Preorder (b) Inorder
4. What is a threaded binary tree?
5. Define a heap. How can it be used to represent a priority queue?
6. Give any two applications of binary heaps.
7. What is hashing?
8. Mention any four applications of a set.
9. What is breadth-first traversal?
10. Define spanning tree of a graph.

PART B — (5 × 16 = 80 Marks)
11. (a) Describe the data structures used to represent lists. (Marks 16)
Or
(b) Describe circular queue implementation in detail giving all the relevant features. (Marks 16)
12. (a) Explain the tree traversals. Give all the essential aspects. (Marks 16)
Or
(b) Explain binary search tree ADT in detail. (Marks 16)
13. (a) Discuss in detail the B-tree. What are its advantages? (Marks 16)
Or
(b) Explain binary heaps in detail. Give its merits. (Marks 16)
14. (a) Explain separate chaining and extendible hashing. (Marks 16)
Or
(b) Explain in detail the dynamic equivalence problem. (Marks 16)
15. (a) Consider the following graph
(i) Obtain minimum spanning tree by Kruskal's algorithm. (Marks 10)
(ii) Explain Topological sort with an example. (Marks 6)
Or
(b) (i) Find the shortest path from 'a' to 'd' using Dijkstra's algorithm in the graph in Figure 2
given in question 15(a). (Marks 10)
(ii) Explain Euler circuits with an example. (Marks 6)

102
Appendix B - University Question papers

B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER 2010


Third Semester
Information Technology
IT 2201 — DATA STRUCTURES AND ALGORITHMS
(Regulation 2008)
Time : Three hours Maximum : 100 Marks
Answer ALL questions
PART A — (10 × 2 = 20 Marks)
1. Define ADT.
2. Clearly distinguish between linked lists and arrays. Mention their relative advantages and
disadvantages.
3. What is meant by depth and height of a tree?
4. Discuss the application of trees.
5. What are the important factors to be considered in designing the hash function?
6. What is a disjoint set? Define the ADT for a disjoint set.
7. What is Euler circuit?
8. What are the two ways of representing a graph? Give examples.
9. Define NP-complete problems.
10. What is meant by backtracking?

PART B — (5 × 16 = 80 Marks)
11. (a) (i) Derive an ADT to perform insertion and deletion in a singly linked list. (8)
(ii) Explain cursor implementation of linked lists. Write the essential operations. (8)
Or
(b) (i) Write an ADT to implement stack of size N using an array. The elements in the stack are
to be integers. The operations to be supported are PUSH, POP and DISPLAY. Take into account
the exceptions of stack overflow and stack underflow. (8)
(ii) A circular queue has a size of 5 and has 3 elements 10, 20 and 40 where F = 2 and R = 4.
After inserting 50 and 60, what is the value of F and R. Trying to insert 30 at this stage what
happens? Delete 2 elements from the queue and insert 70, 80 & 90. Show the
sequence of steps with necessary diagrams with the value of F & R. (8)
12. (a) (i) Write an ADT to construct an AVL tree. (8)
(ii) Suppose the following sequences list nodes of a binary tree T in preorder and inorder,
respectively:
Preorder : A, B, D, C, E, G, F, H, J
Inorder : D, B, A, E, G, C, H, F, J
Draw the diagram of the tree. (8)
Or
(b) (i) Write an ADT for performing insert and delete operations in a Binary Search Tree. (8)

103
Appendix B - University Question papers

(ii) Describe in detail the binary heaps. Construct a min heap tree for the following :
5, 2, 6,7, 1, 3, 8, 9, 4 (8)
13. (a) (i) Formulate an ADT to implement separate chaining hashing scheme. (8)
(ii) Show the result of inserting the keys 2, 3, 5, 7, 11, 13, 15, 6, 4 into an initially empty
extendible hashing data structure with M = 3. (8)
Or
(b) (i) Formulate an ADT to perform for the Union and find operations of
disjoint sets. (8)
(ii) Describe about Union-by-rank and Find with path compression with code. (8)
14. (a) (i) Write routines to find shortest path using Dijkstra’s algorithm. (8)
(ii) Find all articulation points in the below graph. Show the depth first spanning tree and the
values of DFN and Low for each vertex. (8)
Or
(b) (i) Write the pseudo code to find a minimum spanning tree using Kruskal’s algorithm. (8)
(ii) Find the topological ordering of the below graph. (8)
15. (a) (i) Discuss the running time of Divide-and-Conquer merge sort algorithm. (8)
(ii) Explain the concept of greedy algorithm with Huffman codes example. (8)
Or
(b) Explain the Dynamic Programming with an example. (16)

104
Appendix B - University Question papers

B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER 2010


Third Semester
Electrical and Electronics Engineering
EE 2204 — DATA STRUCTURES AND ALGORITHMS
(Common to Electronics and Instrumentation Engineering and Instrumentation and
Control Engineering)
(Regulation 2008)
Answer ALL questions
PART A — (10 × 2 = 20 Marks)
1. Distinguish between linear and non-linear data structures.
2. Write down the steps to modify a node in linked lists.
3. Define a path in a tree.
4. What is a binary search tree?
5. Define hashing.
6. What is meant by open addressing?
7. What is minimum spanning tree?
8. Define depth-first traversal in a tree.
9. Differentiate ‘‘divide and conquer’’ technique from ‘‘branch and bound’’ technique.
10. Explain dynamic programming.
PART B — (5 × 16 = 80 Marks)
11. (a) Write down and explain the algorithms for basic operations on stack ADT.
Or
(b) Explain polynomial manipulation using linked lists with an example.
12. (a) With suitable examples, explain binary tree traversal algorithms.
Or
(b) Explain the following operations in binary search trees :
(i) Insertion of a node (6) (ii) Searching a node (5) (iii) Modification of a node. (5)
13. (a) With suitable examples, explain the basic operations on AVL trees.
Or
(b) Explain the following in hashing :
(i) Folding method (6) (ii) Division method (5) (iii) Linear probing. (5)
14. (a) Explain in detail the Dijkstra’s algorithm to solve the shortest path problem.
Or
(b) Discuss in detail the applications of graphs.
15. (a) (i) With an example, explain backtracking. (8)
(ii) Discuss the asymptotic notations. (8)
Or
(b) Write detailed notes on NP-complete problems.

105
Appendix B - University Question papers

B.E./B.Tech. DEGREE EXAMINATION, APRIL/MAY 2010


Third Semester
Information Technology
IT2201 — DATA STRUCTURES AND ALGORITHMS
(Regulation 2008)
Time: Three hours Maximum: 100 Marks
Answer ALL Questions
PART A — (10 *2 = 20 Marks)
1. Why do we need ADT for implementing Data Structures?
2. Write down a function to insert an element into a queue, in which the queue is implemented as
an array.
3. Represent the following in a AVL tree
k, t, e, v, p, a, m, u, h.
4. Write down pseudocode to perform postorder traversal of a binary tree.
5. Why do we need a Hash table as a data structure as compared to any other data structure?
6. What are the methods for avoiding collision?
7. What is topological sorting?
8. Represent the following graph as an adjacency matrix
9. Prove that (n n lg n) O (n log n) is true or false.
10. Solve the recurrence equation T (n) 2 T (n −1)1,T (1) 1 .

PART B — (5 *16 = 80 Marks)


11. (a) Write a C program to perform the following stack operations .Declare a structure with one
integer data type. Add necessary variables to ensure that you can create a linked representation.
(i) Write a function called ‘push’ that takes two parameters: An integer variable and a stack into
which it would push this element and returns a 1 or a 0 to show success of addition or failure. (6)
(ii) Write a function called ‘pop’ that takes two parameters: An integer pointer and a stack from
which we need to pop this element. (6)
(iii) A display function that would print the contents of stack. Add necessary functions to check
for emptiness or fullness of the stack.(4)
Or
(b) Write algorithms to perform the following in a doubly linked list:
(i) To insert an element in the beginning, middle, end of the list (8)
(ii) To delete an element from anywhere in the list (8)
An element is a structure variable that contains an integer data field and a string data field.
12. (a) (i) Show that the maximum number of nodes in a binary tree of height H is 2 1 1
− H. (4)
(ii) Construct an expression tree for the expression (a b * c) (d * e / f ) −g . (4)
(iii) Write pseudocode to insert and delete from a binary search tree. (8)

106
Appendix B - University Question papers

Or
(b) (i) Show the result of inserting the nodes 2, 1, 4, 5, 9, 3, 6, 7 into an initially empty Binary
Search tree. (6)
(ii) Write down the functions to insert into an AVL tree by calling appropriate functions to
perform double and single rotations also.(10)
13. (a) (i) Given the input {4371, 1323, 6173, 4199, 4344, 9679, 1989} and a hash function of
h(X) = X (mod 10) show the resulting
(1) Separate Chaining hash table (5)
(2) Open Addressing hash table using linear probing (5)
(ii) What are the advantages and disadvantages of various collision resolution strategies? (6)
Or
(b) (i) State and explain the dynamic equivalence problem. (6)
(ii) Explain the path compression algorithm and analyse the Union/Find algorithm used. (10)
14. (a) (i) Give the Prim’s algorithm for determining minimum spanning tree and analyse this
algorithm for its worst case time complexity. (10)
(ii) Determine the minimum spanning tree for the following graph using Prim’s algorithm. (6)
Or
(b) (i) Write an algorithm to determine the biconnected components in the given graph. (10)
(ii) Determine the biconnected components in the following graph. (6)
15. (a) What is a greedy algorithm? Give two examples that can be solved using greedy
algorithm and explain them with example. (16)
Or
(b) What is NP completeness? Explain an NP complete problem with example. (16)

107
Appendix B - University Question papers

B.E./B.Tech. DEGREE EXAMINATION, APRIL/MAY 2010


Third Semester
Electrical and Electronics Engineering
EE2204 — DATA STRUCTURES AND ALGORITHMS
(Common to Electronics and Instrumentation Engineering and Instrumentation and
Control Engineering)
(Regulation 2008)
Time: Three hours Maximum: 100 Marks
Answer ALL Questions
PART A — (10 × 2 = 20 Marks)

1. List out the areas in which data structures are applied extensively.
2. Convert the expression ((A+B)*C-(D-E)^(F +G)) to equivalent Prefix and Post fix notations.
3. How many different trees are possible with 10 nodes?
4. What is an almost complete binary tree?
5. In an AVL tree, at what condition the balancing is to be done?
6. What is the bucket size, when the overlapping and collision occur at same time?
7. Define graph.
8. What is a minimum spanning tree?
9. Define NP hard and NP complete.
10. What is meant by dynamic programming?

PART B — (5 × 16 = 80 Marks)
11. (a) (i) What is a linked list? Explain with suitable program segments any four operations of a
linked list. (Marks 12)
(ii) Explain with a pseudo code how a linear queue could be converted into a circular queue.
(Marks 4)
Or
(b) (i) What is a stack ADT? Write in detail about any three applications of stack. (Marks 11)
(ii) With a pseudo code explain how a node can inserted at a user specified position of a doubly
linked list. (Marks 5)
12. (a) (i) Discuss the various representations of a binary tree in memory with suitable example.
(Marks 8)
(ii) What are the basic operations that can be performed on a binary tree? Explain each of them
in
detail with suitable example. (Marks 8)
Or
(b) (i) Give an algorithm to convert a general tree to binary tree. (Marks 8)
(ii) With an example, explain the algorithms of in order and post order traversals on a binary

108
Appendix B - University Question papers

search tree. (Marks 8)


13. (a) What is an AVL tree? Explain the rotations of an AVL tree. (Marks 16)
Or
(b) (i) Explain the binary heap in detail. (Marks 8)
(ii) What is hashing? Explain any two methods to overcome collision problem of hashing.
(Marks
8)
14. (a) (i) Explain Dijkstra's algorithm and solve the single source shortest path problem with an
example. (Marks 12)
(ii) Illustrate with an example, the linked list representation of graph.(Marks 4)
Or
(b) (i) Write the procedures to perform the BFS and DFS search of a graph. (Marks 8)
(ii) Explain Prim's algorithm to construct a minimum spanning tree from an undirected graph.
(Marks 8)
15. (a) (i) With an example, explain how will you measure the efficiency of an algorithm. (Marks
8)
(ii) Analyze the linear search algorithm with an example. (Marks 8)
Or
(b) Explain how the travelling salesman problem can be solved using greedy algorithm. (Marks
16)

109
Appendix B - University Question papers

B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER 2009


Third Semester
Information Technology
IT 2201 — DATA STRUCTURES AND ALGORITHMS
(Regulation 2008)
Time : Three hours Maximum : 100 Marks
Answer ALL Questions
PART A — (10 × 2 = 20 Marks)
1. What is meant by abstract data type (ADT)?
2. What are the postfix and prefix forms of the expression
A + B* (C – D) / (P – R)
3. What is a Binary tree?
4. Define expression tree.
5. What are the applications of hash table?
6. What is an equivalence relation?
7. Define indegree and out degree of a graph.
8. What is a minimum spanning tree?
9. Compare backtracking and branch-and-bound.
10. List the various decision problems which are NP-Complete.

PART B — (5 × 16 = 80 Marks)
11. (a) (i) Write the insertion and deletion procedures for cursor based linked lists. (8)
(ii) Write the algorithm for the deletion and reverse operations on doubly linked list. (8)
Or
(b) (i) Write an algorithm for Push and Pop operations on Stack using Linked List. (8)
(ii) Explain the addition and deletion operations performed on a circular queue with necessary
algorithms. (8)
12. (a) (i) Write the algorithm for pre-order and post-order traversals of a binary tree. (8)
(ii) Explain the algorithm to convert a postfix expression into an expression tree with an
example. (8)
Or
(b) (i) Write an algorithm to insert an item into a binary search tree and trace the algorithm with
the items 6, 2, 8, 1, 4, 3, 5. (8)
(ii) Describe the algorithms used to perform single and double rotation on AVL tree. (8)
13. (a) Discuss the common collision resolution strategies used in closed hashing system. (16)
Or
(b) (i) What is union-by-height? Write the algorithm to implement it. (8)
(ii) Explain the path compression with an example. (8)
14. (a) (i) What is topological sort? Write an algorithm to perform topological sort. (8)

110
Appendix B - University Question papers

(ii) Write the Dijkstra’s algorithm to find the shortest path. (8)
Or
(b) Write the Kruskal’s algorithm and construct a minimum spanning tree for the following
weighted graph. (16)
15. (a) (i) Formulate an algorithm to multiply n-digit integers using divide and conquer approach.
(8)
(ii) Briefly discuss the applications of greedy algorithm. (8)
Or
(b) Find the optimal tour in the following traveling salesperson problem using dynamic
programming : (16)

111
Appendix B - University Question papers

B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER 2009


Third Semester
Electrical and Electronics Engineering
EE 2204 — DATA STRUCTURES AND ALGORITHMS
(Regulation 2008)
(Common to Instrumentation and Control Engineering and Electronics and
Instrumentation Engineering)
Time : Three hours Maximum : 100 Marks
Answer ALL Questions
PART A — (10 × 2 = 20 Marks)
1. Define Abstract Data Type.
2. Convert the infix expression F) (D/E B/C) (A − ∗ − into a postfix.
3. What are the steps to convert a general tree into a binary tree?
4. List the applications of trees.
5. What do you mean by a heap?
6. Define hashing.
7. What is topological sort?
8. Define biconnected graph.
9. State the greedy algorithm.
10. Mention any two decision problems which are NP-Complete.

PART B — (5 × 16 = 80 Marks)
11. (a) Explain the following operations in a doubly linked list.
(i) Insert an element (6)
(ii) Delete an element (5)
(iii) Reverse the list. (5)
Or
(b) (i) Discuss the algorithms for push and pop operations on a stack. (8)
(ii) Write an algorithm to insert and delete a key in a circular queue. (8)
12. (a) (i) Construct all possible tree structure with 4 nodes. (8)
(ii) Perform preorder, inorder and postorder traversals of the given tree. (8)
Or
(b) Explain the following operations on a binary search tree with suitable algorithms.
(i) Find a node (5)
(ii) Insert a node (5)
(iii) Delete a node. (6)
13. (a) (i) Discuss how to insert an element in an AVL tree. Explain with algorithm. (10)
(ii) What is B-Tree? Explain its properties. (6)
Or

112
Appendix B - University Question papers

(b) (i) Describe the different hashing functions with an example. (8)
(ii) Explain the common collision resolution strategies in open addressing hashing. (8)
14. (a) (i) Explain the breadth first search algorithm. (8)
(ii) Write and explain the Prim’s algorithm with an example. (8)
Or
(b) (i) What is a strongly connected graph? Give an example. (4)
(ii) Write the algorithm to compute lengths of shortest path. (4)
(iii) Explain the depth first search algorithm. (8)
15. (a) Find the optimal tour in the following traveling salesperson problem using dynamic
programming. (16)
Or
(b) (i) Explain the method of solving N queens problem by back tracking.(10)
(ii) Discuss briefly the various asymptotic notations used in algorithm analysis. (6)

113

Das könnte Ihnen auch gefallen