You are on page 1of 11

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) (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 Dijkstras 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

Kruskals 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)

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) (ii) Write the Dijkstras algorithm to find the shortest path. (8) Or (b) Write the Kruskals 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)
B.E/B.Tech DEGREE EXAMINATION Nov/Dec 2007 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. 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 Qempty 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)

B.E/B.Tech DEGREE EXAMINATION May/Jun 2007 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. 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.
(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)
(i) Explain the Prims algorithm with an example. (ii) Write short notes on Biconnectivity.

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)
(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.

You might also like