November / December 2011
PROGRAMMING AND DATA STRUCTURES - I
Anna University
1 question papers available. Select an examination session to view its question paper.
PROGRAMMING AND DATA STRUCTURES - I
Based on available extracted papers. Question groups and frequency are provisional, not official syllabus weightage or examination predictions.
Write a routine to find the strongly connected components in a digraph.
1 eligible source papersa. i) Define a class Fixed_deposit that stores principal amount, period of investment, interest rate. Write a program to test your class to see that it does the following tasks. {6) > Initialize the object Without arguments > Initialize the object during runtime, use default interest rate > Fixed_deposit FD1=FD2 ii) | Write a code to explain the use of the following terms. ~~ (10) Static variable and static function Pointer to functions Const member function Const object new and delete. ற றத
0 eligible source papersa. i) Define a class String. Write a-code to Perform the following operations using operator overloading . (8) A. String concatenation --- 51452 ம. String Comparison --- S1==S2 C. Remove the substring from the main string $1 - 52 ii) | Explain the 3 basic Type Conversion operations with example code to perform the conversion. ; {8) [OR] b. i) Define a class Complex_Number. Write a code to overload the following operators using Friend function. (8 A. C1 ++ B. --C1 C. .<<C1 (to print the complex number). ii) What is Function object? Write a programto overload the Function call operator () (8)
0 eligible source papersa. i) Define a Time class. Throw an exception when invalid time is an input, also how do you handle this exception? (4) ji) Write a-class template to represent a generic vector. Include the member functions to perform the following tasks: (12) To create the vector Modify the value of a given element. Find the minimum element and return that element. Write a function template for swap. Sort the elements using swap function. 2௦௦௫ [OR] b. i) Write a program to read the following class Hierarchy. Create a class employee that stores name and employee ID. Then create two derived classes, one for storing the details of permanent employee and daily employees. Through derived class object initialize the members of base class. Write a function salary to calculate the salary in both the classes (Assume Only DA % different). A display() function is used in all classes to display the class contents. How do you use runtime polymorphism to display the class contents? (8) ii) Consider the following class hierarchy. The class master derives information from both account and admin classes which in turn derive information from the class person. Define all the four classes. What will be the problem in this class hierarchy and how do you soive it. Also write a program to create, update and disptay the information contained in master objects. (8) Person Name, Code Account Admin pay experience Master 4 Name, Code Pay , experience Fig 13.b
0 eligible source papersa. i) Do the following operations in the given tree. A. Search (splay ) the element 72 using Top down or bottom up splay approach (3) 46 / \ 17 88 / \ / \ 15 32 65 97 / lL \ 28 54 82 / 76 / \ 72 80 B. Remove 46 in the above tree and Merge the two splay trees. (3) ii) Write a routine for AVL tree insertion and Deletion. Insert the following _ elements in the empty tree and how do you balance the tree after each Elements — 3, 5, 4, 6, 9, 7, 8, 2, 1, 20 (10) [OR] element insertion? (3) b.i) A. Insert the following elements using Red-Black tree CNGAHQWPDXY (3) B. Show the tree after removing the elements G & W ii) Write a pseudocode for Binary heap insertion and deletion. Build the heap using the following elements: 70,150,80,40,100,20,30,10,110,90,60,50,120 Also how do you find the 2" Minimum element in the above binary heap. (10)
0 eligible source papersa. i) Write a Pseudocode for Dijikstra’s shortest path algorithm and also trace the (8) algorithm for the following graph. Fig 15.a Write a routine to perform Topological sort. Show the result of applying topological sort to the above graph (8) [OR] Write a routine to implement Kruskal’s algorithm. Find the minimum spanning tree in the following undirected graph (Show the result of each (8) stage ) i) b. i) Fig 15.b ii) Write a routine to perform a depth first search of an undirected graph. Give @) the DFS and articulation points for the above graph.
0 eligible source papersHistorical analysis based on extracted question papers. Topic classifications, marks and planning estimates are provisional.