ANNA UNIVERSITY :: CHENNAI - 600 025
MODEL QUESTION PAPER
B.E. DEGREE PROGRAMMES
CS 131 — PROGRAMMING AND DATA STRUCTURES |
| Time: 3hrs | Max Marks: 100 |
| Answer all Questions |
| PART - A (10 x 2 = 20 Marks) |
| 1. | Differentiate Iteration and Recursion. |
| 2. | What are the primitive data types in C? |
| 3. | What is the use of preprocessor in C? |
| 4. | What is meant by Garbage Collection? |
| 5. | What are the basic operations performed on any data structure? |
| 6. | Define Stack and Queue. |
| 7. | How binary search tree is different from binary tree? |
| 8. | Define Hashing. |
| 9. | Write the time complexities of bubble sort and quick sort. |
| 10. | Find the time complexity to perform binary search in an unsorted array of ‘n’ numbers. |
| PART - B (5 x 16 = 80 Marks) |
| 11. | Write a modular program in C to perform addition, subtraction and multiplication of two matrices of order 'n x n' and find where A, B, C and D are 'n x n' matrices. |
| 12.a) | Differentiate "while" statement and "do–while" statement with an example program. |
| (OR) |
| 12.b) | Explain how the "switch" statement is used in the programs instead of multiple "if–else" statements with suitable example program. |
| 13.a) | Explain how the following "infix" expression is evaluated with the help of Stack :
5 * ( 6 + 2 ) - 12 / 4 |
| (OR) |
| 13.b) | Explain the procedure to delete a node with a given item of information in a singly linked list. |
| 14.a) | Construct a binary tree to satisfy the following orders :
Inorder : D B F E A G C L J H K
Postorder : D F E B G L J K H C A |
| (OR) |
| 14.b) | Construct a heap for the following set of numbers :
{ 97, 88, 95, 66, 55, 95, 48, 66, 35, 48, 55, 62, 77, 25, 38, 18, 40, 30, 20, 24 } |
| 15.a) | Explain the algorithm for Insertion sort and sort the following array :
77, 33, 44, 11, 88, 22, 66, 55. |
| (OR) |
| 15.b) | Explain how the divide and conquer technique is implemented in binary search. |