Upcoming SlideShare
×

# Data structures question paper anna university

27,556
-1

Published on

Published in: Technology
9 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total Views
27,556
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
748
0
Likes
9
Embeds 0
No embeds

No notes for slide

### Data structures question paper anna university

1. 1. data structures question paper anna university. CS 1151 DATASTRUCTURESPART – A (10 * 2 = 20 Marks)/Answer ALL questions1. Define ADT.2. How do you push and pop elements in a linked stack?3. Prove that the number of odd degree vertices in a connected graph should be even.4. Define NP hard and NP complete.5. Define binary search tree.6. List out and define the performance measures of an algorithm.7. What is Recursion? Explain with an example.8. List out the various techniques of hashing.9. What is the worst case complexity of Quick sort?10. State the algorithmic technique used in merge sort.PART B (5 * 16 = 80 Marks)11.(a) Derive the best, average, worst case time complexity of a linear search.(b) (i) Develop an algorithm for binary search. Validate the algorithm with a suitable data set.(10)(ii) What is Top down approach? Explain. (6)12. (a) Write ADT operations for array implementation of polynomial addition. (b) WriteADT operations for array implementation of a queue.13. (a) Write insertion algorithm for AVL tree. Write suitable rotation algorithms. (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(b) (i) Explain the quick sort algorithm. ( 8 )(ii) Explain external sorting. Give relevant example. ( 8 )15. (a) Explain Dijkstra’salgorithm using the following graph. Find the shortest path between v1, v2, v3, v4, v6 andv7.[Diagram not available] (b) (i) Write ADT operation for Prim’s algorithm. ( 8 )(ii) Explain the topological sort algorithm. ( 8 ) 1. What do you mean by sorting? Mention the di erent types of sorting, give some examples and explain any one indetail. [16 marks] 2. Compare the advantage and disadvantage of bubble, insertion and selection sort. 3. Write a program to sort the elements whose worst and average case are O(n log n). [16 marks]
2. 2. 4. Write a program to explain selection sort . Which type of technique does it belong. [16 marks]5. Write a program to explain selection sort . Which type of technique does it belong. [16 marks]6. Write a program to sort the elements whose worst case is O(n2) and average case is O(n log n). [16 marks]7. (a) Explain selection sort indetail. (b) Explain bubble sort indetail. [8+8]8. Write an algorithm for routine merge(x,lb1,ub1,ub2) that assumes that x[lb1] through x[ub1] and x[ub1 + 1] through x[ub2] are sorted and merges the two into x[lb1] through x[ub2]. [16 marks]9. (a) Explain Quick sort with algorithm. (b) Analyse the worst case performance of Quick sort and compare with Selection sort.[8+8 marks]10. (a) Write a C program to sort the elements of an array using Quick sort with suitable example. (b) What is the worst case and best case time complexity of the above program?11. Write an algorithm for quick sort. What is its time complexity. [16 marks]12. (a) Write an algorithm for selection sort (b) Sort the following numbers using selection sort and give the required steps. 96,31,27,42,34,76,61,10,4 [8+8]13. (a) Using linear search delete the number 26 from the list of numbers and give the steps. 10,7,17,26,32,92 (b) Write a C program to implement the same. [8+8 marks]14. (a) Distinguish between linear and binary search methods. (b) Write an algorithm for non-recursive binary search method. [8+8 marks]15. (a) Write a C program to sort the elements of an array using bubble sort technique with a suitable example. (b) What is the worst case and best case time complexity of bubble sort? [10+6 marks]16. (a) Write a C program to sort given integers using partition exchange sort. (b) Derive the time complexity of partition exchange sort. [8+8]17. Write a C program that searches a value in a stored array using binary search. What is the time complexity of binary search? [16 marks]18. (a) Write a C program to merge two sorted arrays of integers. (b) Derive the time complexity of merge sort. [8+8 marks]19. (a) Write and explain non-recursive algorithm for binary search with suitable example and discuss the various time complexities of binary search. (b) Suppose that the list contains the integers 1,2,8 in this order. Trace through the steps of binary search to determine what comparisons of keys are done in searching. i. To lo cate 3 ii. To lo cate 4.5 [8+8 marks]20. Trace through the steps by hand to sort the following list in Quick sort. 28 7 39 3 63 13 61 17 50 21 [16 marks]21. What are the advantages and disadvantages of stack ? Write a program to illustrate stack operation ? [16 marks]22. Give an algorithm / C program to reverse a singly linked circular list inplace. [16 marks]23. What are the advantages and disadvantages of stack ? Write a program to illustrate queue operation ? [16 marks]