B.E/B.Tech Degree Practical Examinations Oct / Nov – 2012
EC2209 - Data Structures and Object Oriented Programming Lab
B.E Electronics and Communication Engineering
Regulations - 2008
Time: 3 Hours
1
a
Maximum Marks: 100
Write complex class to represent a complex number as an attribute and overload + operator to add two complex numbers as a member function. Test the program with proper inputs from main function.
50
Write a C++ program to sort the following integers using quick sort with 50
b
median-of- three partitioning.
3, 10, 4, 1, 5, 9, 12, 6, 15, 13, 25, 1, 5, 3, 9, 2
2
a
Write a C++ program to count the number of objects created. Use static member 50 to count the number of objects created. Test the program with proper input with main function.
50
b
3
Write a C++ Program to reverse the string using stack.
a
Write a C++ program to sum the two data members in a class using a friend 50 function. Test the program with proper input with main function.
b
Write a C++ program to convert the following infix expression to postfix 50 expression. 2 + 3 * 5 - (6*7) + 9
4
a
50
Implement the following class hierarchy.
Shape
Sphere
Cylinder
Square
The base class contains pure virtual function to calculate the area of the shape.
Implement function in each of the derived classes and test the program with proper inputs from main function. b Write a C++ program that removes all duplicate elements from a doubly linked 50 list. 5
Write a C++ program to create the singly linked list using arrays and do the following 25 operations on a created list. i 20
ii
Display right to left
20
iii
Search for a number
20
iv
6
Display left to right
Number of elements in the list
15
a
Write a C++ program to implement the doubly linked list and count the number of 50 elements which has the same data item.
b
Write a