Feb Mar 2022
Data Structures
Anna University
1 question papers available. Select an examination session to view its question paper.
Data Structures
Based on available extracted papers. Question groups and frequency are provisional, not official syllabus weightage or examination predictions.
Write the output of the following code: 2 int main() { int a[5] = {10, 20, 30, 40, 50}; int* ptr; ptr = &x[3]; printf("%d \t %d \t %d \n", *ptr, *(ptr+1), *(ptr-1)); return 0; }
0 eligible source papersWrite the output of the following code and justify your answer (step by step): 2 int main() { int a =5, b =10, c =6; a = b++; c = --a ; b = ++b + --c * c--; printf("%d %d %d", a, b, c); }
0 eligible source papersDefine an ADT. 2
0 eligible source papersWhat are double ended queues? 2
0 eligible source papersDefine depth and height of a tree. 2
0 eligible source papersState the properties of a Binary Heap. 2
0 eligible source papersWhat does Shell sort use to sort a sequence of elements. Show with an 2 example.
0 eligible source papersDistinguish between linear search and binary search. 2
0 eligible source papersShow the resulting hash directory of bucket size 3 when hashing the keys: 9, 5, 2 8, 4, 7, 2, 6, 3 using extendible hashing.
0 eligible source papersWhat is a disjoint–set? 2
0 eligible source papers(a) (i) Write a C program to construct a Square matrix and compute the following 8 using functions and return the answer to the main: a. Find the mean of the upper triangular matrix. b. Find the product of the diagonal elements. c. Find the median of the lower triangular matrix. Display all the answers in the main function appropriately. (ii) Write about Structures, Union and Enumerated data types with an example for 5 each.
0 eligible source papers(b) (i) Write a C program to read and write into a binary file. 8 (ii) Write about the different types of preprocessor directives with example for 5 each.
0 eligible source papers(a) (i) Formulate an ADT to implement a Circular queue using a linked list. 9 (ii) Convert the infix expression into its corresponding postfix expression. 4 (a+b*c↑ d/e)+(d*e/f) Simulate using stack and show each step.
0 eligible source papers(b) (i) Write the routines to insert a new node and delete a node in an ordered singly 9 linked list. (ii) Write the routine to display the previous node for any node in a doubly linked 4 list.
0 eligible source papers(a) (i) Formulate an ADT to insert and delete in a Binary Search Tree. 8 (ii) Insert into an empty binary search tree the given numbers in the given order: 5
0 eligible source papers12, 4, 6, 2, 8, 9, 5, 1, 14, 11, 7, 3. Traverse the obtained tree in preorder, inorder and postorder. [OR] 13 (b) (i) Construct an expression tree using stack for the expression, 8 a + (b * c) + d * (e + f). Show each step in order. From the obtained tree, traverse and write the prefix , infix and postfix expressions. (ii) What are priority queues? What are the data structures used to implement a 5 priority queue? Discuss about at least two applications for it. 14 (a) (i) Write the algorithm for sorting using Insertion sort. 8 (ii) Sort the following numbers using Heap sort. 5
0 eligible source papers8,17,9,12,5,2,7,3,18,10,14 [OR] 14 (b) (i) Write the algorithm to sort using Merge sort. 8 (ii) Sort the following numbers using Quick sort. 5
0 eligible source papers8,17,9,12,5,2,7,3,18,10,14
0 eligible source papers(a) (i) Write an ADT to implement hashing using Separate Chaining method. 8 (ii) The keys 78, 75, 88, 98, 69, 59, 25 and 15 are inserted into an initially empty 5 hash table of length 10 with hash function h(k) = k mod 10. What is the resultant hash table with open addressing techniques, (i) linear probing (ii) quadratic probing and (iii) separate chaining. When insertion fails in any case, apply rehashing.
0 eligible source papers(b) (i) Explain with code the union operation that are performed arbitrarily, union by 15 size, union by height and Find with path compression.
0 eligible source papers(i) When multiple applications are running on a PC, the operating system puts the 10 running applications on a list and then access through them in a round robin fashion, giving each of them a time slot to execute while other applications are waiting in the list. Write a ‘C’ program with necessary functions to create such list so that when it reaches the end of the list it can cycle around to the front of the list. (ii) Imagine you develop an online website which requires a user login, to enter the 5 E-mail and password to authenticate that the account belongs to that person. You want to ensure that the password is not sniffed when it is sent from the client to the server for verification. Choose an appropriate data structure and justify that it is most suitable to implement this application with 2 or more test cases.
0 eligible source papersHistorical analysis based on extracted question papers. Topic classifications, marks and planning estimates are provisional.