You are on page 1of 16

# B.E/B.Tech.

DEGREE EXAMINATION, MAY/JUNE 2007 Third Semester Electronics and Communication Engineering Time: Three hours Minimum: 100 Marks PART - A (10 * 2 = 20 Marks) Answer ALL questions 1. List out and define the performance measures of an algorithm. 2. What is Recursion? Explain with an example. 3. Define ADT. 4. How do you push and pop elements in a linked stack? 5. Define binary search tree. 6. List out the various techniques of hashing. 7. What is the worst case complexity of Quick sort? 8. State the algorithmic technique used in merge sort. 9. Prove that the number of odd degree vertices in a connected graph should be even. 10. Define NP hard and NP complete. PART B (5 * 16 = 80 Marks) 11.(a) (i) Develop an algorithm for binary search. Validate the algorithm with a suitable data set. (10) (ii) What is Top down approach? Explain. (6) Or (b) Derive the best, average, worst case time complexity of a linear search.

12. (a) Write ADT operations for array implementation of polynomial addition. Or (b) Write ADT operations for array implementation of a queue. 13. (a) Write insertion algorithm for AVL tree. Write suitable rotation algorithms. Or (b) (i) Explain the algorithm for separate chaining. ( 8 ) (ii) Explain implementation of priority queue ( 8 ) 14. (a) Write ADT operations for heap sort. Using the above algorithm sort the following: 35 45 25 11 6 85 17 35 Or (b) (i) Explain the quick sort algorithm. ( 8 ) (ii) Explain external sorting. Give relevant example. ( 8 ) 15. (a) Explain Dijkstras algorithm using the following graph. Find the shortest path between v1, v2, v3, v4, v6 and v7. [Diagram not available] Or (b) (i) Write ADT operation for Prims algorithm. ( 8 ) (ii) Explain the topological sort algorithm. ( 8 )

B.E/B.Tech DEGREE EXAMINATION May/Jun 2007 Third semester Computer Science and Engineering CS1151 - DATA STRUCTURES (Regulation 2004) Time: 3 hours Answer ALL questions PART A (10 x 2 =20 marks) 1. Write the basic idea behind the Divide and conquer strategy. 2. What is O-notation? 3. What is an ADT? 4. List the characteristics of stacks 5. What is binary search tree? 6. What is hashing? 7. Develop pseudo code that will illustrate the process logic in Insertion sort. 8. What is the best case time complexity of the Quick sort algorithm? 9. What is an adjacency list? When is it used? 10. What is an activity node graph? PART B (5 x 16 = 80) 11. (a) (i) Outline in brief about Top-down design. Maximum marks: 100

(ii) Foumulate an algorithm to convert a decimal integer to its corresponding octal representation. (or) (b) (i) Discuss in detail about the Implementation of algorithms. (ii) Given the character representation of an integer, convert it to its conventional decimal format. (a) (i) Write a program in C to return the position of an element X in a list L. (ii) State and explain the algorithm to perform Radix sort. (or) (b) (i) Write a program in C to create an empty stack and to push an element into it. (ii) Explain how queues can be implemented using Arrays. 13. (a) (i) Construct an expression tree for the expression A + (B-C) * D + (E * F). (ii) Write a program in C to create an empty binary tree and to search for an element X in it. (or) (b) (i) Explain in detail the Linear probing technique. (ii) Write a function to delete the minimum element from a Binary heap. Routine to perform Deletion in a binary heap: 14(a) State and explain the algorithm to perform Heap sort. Also analyze the time complexity of the algorithm. (or)

(b) Write a C program to perform Merge sort. Also analyze the time complexity of the algorithm. 15. (a) (i) Formulate an algorithm to find the shortest path using Dijkstras algorithm. (ii) Construct a Minimum Spanning Tree for the graph shown below.

1. MST using Prims algorithm 2.MST using Kruskals algorithm (or) b) (i) Explain the Prims algorithm with an example. (ii) Write short notes on Biconnectivity.

B.E/B.Tech DEGREE EXAMINATION Nov/Dec 2007 Third semester Computer Science and Engineering CS1151 - DATA STRUCTURES (Regulation 2004) Time: 3 hoursMaximum marks: 100 Answer ALL questions PART A (10 x 2 =20 marks) 1. When will you say an algorithm efficient? Give the notation for time complexity. 2. What is top-down design? Is C language a top-down design? Justify your answer. 3. Why is linked list used for polynomial arithmetic? 4. Write the role of stack in function call. 5. What is the minimum number of nodes in an AVL tree of height 5? 6. What is the use of sentinel value in binary heap? 7. Which is the best way of choosing the pivot element in quick sort? 8. Merge sort is better than insertion sort. Why? 9. Define a graph. How it differs from tree? 10. What is minimum spanning tree? Name any two algorithms used to find MST.

PART B (5 x 16 = 80) 11. (a) (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) (b) (i) How would you implement a stack of queues? Write routines for creation and inserting of elements into it. (8) (ii) Write routines to insert heterogeneous data into the list. (8) 12. (a) (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) b. (i) Show the result of inserting 2, 1, 4, 5, 9, 3, 6, 7 into an empty AVL tree. (6) (ii) Write the procedures to implement single and double rotations while inserting nodes in an AVL tree. (10) 13. (a) Explain, with suitable examples the basic heap operations and write algorithms for the same. (16) (or)

(b) 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. (16) 14. (a) (i) Write the routine for sorting n elements in increasing order using heap sort. (12) (ii) Sort 3, 1, 4, 1, 5, 9, 2, 6 in decreasing order using heap sort. (4) (or) (b) (i) Explain with example, about the insertion sort. (6) (ii) What is external sorting? Discuss the algorithms with proper examples. (10) 15. (a) (i) Discuss and write the program to perform topological sorting. (6) (ii) What is single source shortest path problem? Discuss Dijikras single source shortest path algorithm with an example. (10) (or) (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. (8)

MC1604 DATA STRUCTURES (Regulation 2005) Time : 3 hours PART A (10 x 2 = 20 MARKS ) 1. Write the applications of stack? 2. Differentiate the linear list and linked list 3. Define sibling, height of a tree. 4. What is tree traversal? Write the routine for inorder traversal 5. Write the time complexity for merge and radix sort 6. Why do we go for double hashing? 7. what is transitive closure? Write its worst case complexity 8. Define single source and all-pairs shortest path problem? 9. What is garbage collection? How is it performed 10. Write the need for compaction PART B (5 x 16 = 80 MARKS ) 11. a) The problem: It has n people, numbered from 1 to n, are sitting in a circle. Starting at person 1, a hot potato is passed. After m passes the person holding the potato is eliminated, the circle closes ranks, and the game continues with the person who was sitting after the eliminated person picking up the hot potato. The last remaining person wins. Thus, if m=1 and n=5, player 3 wins and the order of elimination is 2,4,1,5. Use suitable data structure to solve this problem OR Maximam Marks:100

b) Discuss and Write the routines to implement two Stacks using only one array. Your stack routine should not declare an overflow unless every slot in the array is used

12. a) Explain Huffman coding algorithm with example and write the routines to generate Huffman trees OR b) Construct a Binary Search Tree using 10 distinct keys. Write the procedure to sort the keys in increasing order using proper tree traversal ii) Write short notes on threaded binary tree 13. a) Write the routines to sort n elements using merge and insertion sort. ii) Ascent the data 2, 7, 4, 5, 9, 3, 1, 6, using the above algorithms OR (b) Briefly explain the various hashing techniques ii) Given input (371. 323, 173, 199, 344, 679, 989) and hash function h(x) = x mod 10, show the resulting. ii) Given input (371. 323, 173, 199, 344, 679, 989) and hash function h(x) = x mod 10, show the resulting. b) Closed hashing using linear probing, quadratic probing and double hashing h2(x) = 7 (x mod 7) 14. a) Write the routines for Prims and Kruskals algorithm to find the minimum spanning tree of the graph G ii) Find the minimum spanning tree for the following graph using Prims and Kruskals algorithm OR

b) Discuss in detail about flow problem with proper example and write the routine for Ford-Fulkerson algorithm

15. a) Discuss in detail about Automatic list Management OR b) Write the routines to check whether the given string is Palindrome or not. Use the basic operations of doubly linked list to perform the same.

B.E/B.Tech DEGREE EXAMINATION Nov/Dec 2006 Third semester Computer Science and Engineering CS1151 - DATA STRUCTURES (Regulation 2004) Time: 3 hours Maximum marks: 100 Answer ALL questions

PART A (10 x 2 =20 marks) 1. What is meant by top-down design? 2. What notation is used to specify the complexity of an algorithm? 3. What is an Abstract Data Type (ADT)? 4. Define a list. Mention any two operations that are performed on a list 5. Is the following tree an AVL tree? Justify your answer. 6. Give a simple hash function when the input keys are integers . 7. How many passes does the insertion sort algorithm do to sort a list of 5 elements? What happens in its ith pass? 8. How many comparisons are done to merge two sorted lists of lengths m and n into a single sorted list?

9. Draw a directed acyclic graph with 4 vertices and give its Topological sort. 10. Define the minimum spanning tree (MST) of an undirected graph.

PART B (5 x 16 = 80) 11. (a) What is the Stack ADT? Give any one implementation of Stack and explain

clearly the data structure and the routines used. (or) (b) How does a queue works? Explain the algorithm for inserting and deleting from a Queue. 12. (a) (i) Show that the maximum number of nodes in a binary tree of height h is 2(h+1) - 1. (ii) What is meant by collision resolution in hashing? Explain in detail any one

strategy for dealing with it. (or) b) (i) Define a binary search tree (BST). Write a routine to insert a node into a BST. (ii). Give one implementation of a priority queue and explain the routines used 13. (a) Write down the complete QUICKSORT algorithm and illustrate its working to sort the list (45, 23, 11, 35, 62, 87, 24, 66) (or) (b) Write down the complete HEAPSORT algorithm and illustrate its working to sort the list ( 25, 73, 10, 95, 68, 82, 22, 60 ).

14. (a) Explain with examples how a node is inserted into an AVL tree. Discuss all possible cases. (or) 14. (b) What is an external sort algorithm? Explain, with an example. 15(a) 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 (or) (b) Write a routine to find a minimum spanning tree of a weighted directed graph. Use it to find the MST of the following graph.

MCA DEGREE EXAMINATION, JANUARY 2009 First Semester MC 1604 - DATA STRUCTURES (Regulation 2005) Time : 3 hours PART A (10 x 2 = 20 MARKS) 1. Write down row major array addressing function for a two Dimensional array? 2. What are the advantages of a circular queue over a conventional lineqr queue? 3. Define binary tree and Give an example? 4. Explain post order traversal of a binary tree? 5. Explain Exchange sort technique? 6. Write algorithm for binary search? 7. Define adjacency matrix representation of a graph? 8. Define shortest path problem. Mention any one solution to the problem? 9. Bring out the advantages of linked list representation over sequential allocation? 10. Give an algorithm for insertion of an element as first element into a singly linear Linked list? PART B (5 x 16 = 80 MARKS) 11 (a) Define Queue as an abstract data type. Specify domain, functions and axioms of Queue? OR (b) Explain with an illustrative example a method of converting an infix expression into equivalent suffix expression and hence design an algorithm? Maximam Marks:100

12(a) Design an algorithm to traverse through an in order threaded binary tree. Hand simulate the same on an inorder threaded binary tree of your choice? OR (b) Construct a binary tree with atleast 18 nodes. Give an adjacency matrixer representation to it. Design an algorithm to travers through the binary tree in preorder based on the adjacency matrix. 13 (a) Design an algorithm to sort a list of n elements using merge sort. Hand simulate on the data set (98 67 83 08 18 104 07). Give its time complexity. OR (b) Define hashing? Discuss various has functions and their limitations. 14 (a) Consider a graph of your choice with atleast 3 stages. Mark the source and destination vertices. Explain Dijkstras algorithm to trace a shortest path from source to destination and hence design algorithm. OR (b) Given a graph characterized by an adjacency matrix, design algorithms to (i)Obtain the corresponding incidence matrix. (ii) Check if graph is connected 15. (a) realize stack operations using doubly linked list. OR (b) Explain how linked list can be used to design a dynamic dictionary of English words.