Sunteți pe pagina 1din 2

ANNA UNIVERSITY : CHENNAI 600 025 B.E.DEGREE PRACTICAL EXAMINATIONS OCT/NOV 2012.

. EC 2209-DATA STRUCTURES AND OBJECT ORIENTED PROGRAMMING LAB B.E ELECTRONICS AND COMMUNICATION ENGINEERING III SEMESTER Regulations - 2008 Time: 3 Hours 1 Maximum Marks: 100 100

Write a program in C++ to calculate area of a circle, rectangle and square using polymorphism. Define a class vehicle. Inherit vehicle into two wheelers and four wheelers. Inherit two wheelers into bicycles and scooters. Inherit four wheelers into diesel vehicle and petrol vehicles. Provide a virtual function that calculates the mileage of the vehicle. (Mileage=distance travelled in Km/Fuel consumed). Write a program in C++ to compute the number of nodes in a list using array Implement a class list using array. Define methods to add a node in the list, to delete a node in the list, to calculate the total number of nodes in the list and to find out the maximum value in the list. Implement a class list using single linked list. Define methods to add a node in the list, to delete a node in the list, to calculate the total number of nodes in the list and to find out the maximum value in the list Implement a class list using cursor. Define methods to move to next value, move to previous value, to find current node and to add an item using arrays Implement a class list using cursor. Define methods to move to next value, move to previous value, to find current node and to add an item using linked list. Write a program in C++ to implement stack operations using array. Write a program in C++ to implement stack operations using linked list.

100

3 4

100 100

100

6 7

100 100

8 9

100 100 100

10 Write a program in C++ to implement queue operations using array.

11 Write a program in C++ to implement queue operations using linked list. 12 Write a program in C++ to sort a set of values using heap sort. 13 Write a program in C++ to sort a set of values using quick sort. Let the centre element be the pivot element. 14 Given two strings. Write a program in C++ to check string1 is a superset of string2. Note: If string1=a b c and string2=b c then string1 is a superset of string2. If string1=a b c and string2=b b then string1 is not a superset of string2. 15 Implement queue operations using two stacks in C++. 16 Write a C++ program to create a mirror image of a tree 17 Write a C++ program to convert the given integer into a string. 18 Write a C++ program to overload - and + for a stack class such that + provides push and provides pop 19 Define a class Theexception which contains member functions for displaying messages regarding stack underflow and overflow and when overflow occurs it asks for increasing stack size. If the user says yes it should respond back with increasing stack size. Use dynamically allocated array for implementing stack. 20 Write a program for generic queue class with two member functions insert and delete. Use the array to implement the queue.

100 100 100

100

100 100 100 100

100

100

S-ar putea să vă placă și