SARDAR RAJA COLLEGE OF ENGINEERING RAJA NAGAR, ALANGULAM Department of Electronics & Communication Engineering Subject Name : DATA STRUCTURES AND OBJECT ORIENTED PROGRAMMING IN C++ Subject Code : EC 2202 Year/Branch : II/ECE Semester : III Prepared By, A.Kanagaraj, Asst.prof/CSE.
SYLLABUS EC 2202 DATA STRUCTURES AND OBJECT ORIENTED PROGRAMMING IN C++ 3 0 0 3 AIM To provide an in-depth knowledge in problem solving techniques and data structures. OBJECTIVES. To learn the systematic way of solving problems. To understand the different methods of organizing large amounts of data. To learn to program in C++. To efficiently implement the different data structures. To efficiently implement solutions for specific problems UNIT I PRINCIPLES OF OBJECT ORIENTED PROGRAMMING 9 Introduction- Tokens-Expressions-contour Structures Functions in C++, classes and objects, constructors and destructors,operators overloading and type conversions. UNIT II ADVANCED OBJECT ORIENTED PROGRAMMING 9 Inheritance, Extending classes, Pointers, Virtual functions and polymorphism, File Handling Templates, Exception handling, Manipulating strings. UNIT III DATA STRUCTURES & ALGORITHMS 9 Algorithm, Analysis, Lists, Stacks and queues, Priority queues-binary Heap-Application, Heaps hashinghash tables without linked lists UNIT IV NONLINEAR DATA STRUCTURES 9 Trees-Binary trees, search tree ADT, AVL trees, Graph Algorithms-Topological sort, shortest path algorithm network flow problems-minimum spanning tree - Introduction to NP - completeness. UNIT V SORTING AND SEARCHING 9 Sorting Insertion sort, Shell sort, Heap sort, Merge sort, Quick sort, Indirect sorting,bucket sort, Introduction to Algorithm Design Techniques Greedy algorithm (Minimum Spanning Tree), Divide and Conquer (Merge Sort), Dynamic Programming (All pairsshortest Path Problem). Total hours = 45 TEXT BOOKS: T1. Mark Allen Weiss, Data Structures and Algorithm Analysis in C, 3rd ed, Pearson Education Asia, 2007. T2. E. Balagurusamy, Object iented Programming with C++, McGraw Hill Company Ltd., 2007. REFERENCES: 1. Michael T. Goodrich, Data Structures and Algorithm Analysis in C++, Wiley student edition, 2007. 2. Sahni, Data Structures Using C++, The McGraw-Hill, 2006. 3. Seymour, Data Structures, The McGraw-Hill, 2007. 4. Jean Paul Tremblay & Paul G.Sorenson, An Introduction to data structures with applications, Tata McGraw Hill edition, II Edition, 2002. 5. John R.Hubbard, Schaum s outline of theory and problem of data structure with C++, McGraw-Hill, New Delhi, 2000. 6. Bjarne Stroustrup, The C++ Programming Language, Addison Wesley, 2000 7. Robert Lafore, Object oriented programming in C++, Galgotia Publication
MICRO LESSON PLAN HOURS LECTURE TOPIC TEXT BOOKS Unit-1 1 Introduction, Tokens T2 2 Expressions, Contour Structures T2 3 4 Functions in C++ T2 5 T2 classes and objects 6 T2 7 constructors and destructors T2 8 operators overloading T2 9 type conversions T2 Unit-2 10 Inheritance T2 11 Extending classes T2 12 13 Pointers T2 14 Virtual functions and polymorphism T2 15 File Handling T2 16 Templates T2 17 Exception handling T2 18 Manipulating strings T2 Unit-3 19 Algorithm, Analysis T1 20 21 Lists T1 22 23 Stacks T1 24 queues T1 25 Priority queues-binary Heap-Application, T1 26 Heaps T1 27 hashing-hash tables without linked lists T1 Unit-4 28 Tree, Binary trees T1 29 search tree ADT T1 30 AVL trees T1 31 Graph Algorithms-Topological sort T1 32 shortest path algorithm T1 33 network flow problems T1 34 T1 minimum spanning tree 35 T1 36 Introduction to NP - completeness. T1 Unit-5 37 Sorting Insertion sort, Shell sort T1 38 Heap sort, T1 39 Merge sort T1 40 Quick sort T1 41 Indirect sorting, Bucket sort, T1 42 Introduction to Algorithm Design Techniques Greedy algorithm (Minimum Spanning Tree) T1 43 Greedy algorithm (Minimum Spanning Tree) T1 44 Divide and Conquer (Merge Sort), T1 45 Dynamic Programming (All pairs Shortest Path Problem). T1
QUESTION BANK UNIT I PART-A 1. What is an identifier?give example. 2. What is a token?give example. 3. What is an expression?give example. 4. Mention the use of function? 5. What is a) class b)object? 6. Define a) contructor b)destructor. 7. Mention about operator overloading. 8. What is the use of Operator overloading? 9. What is the use of scope resolution operator? 10. What is a friend function and virtual function? PART B 1.(i)Explain briefly about the various data types used in C++. (ii)explain Tokens and Expressions in detail. 2.(i)Discuss about functions with an eg and their use. (ii)what happens when a function call is made in a program? 3.(i)Explain about classes and objects in C++ with an eg? (ii)how to define a member function in a class? 4.Explain about a Constructor in detail. 5. Explain about operator overloading in detail. 6. Explain about destructors in detail. 7. Explain about the operators used in C++ in detail. 8. Explain about control structures in detail. UNIT-II PART A 1. Define Inheritance.Give Eg. 2. What is an abstract class? 3. What is the use of seekg() and seekp()? 4. What is a pointer? What are the types of pointers? 5. Define Virtual function. 6. Define Polymorphism. 7. Write about Templates. 8. Define Exception handling 9. How strings can be manipulated? 10. What is a pure virtual function? Part B 1. Explain about inheritance and its type in detail with examples. 2. Write in detail about extending classes. 3. Explain the need of pointers,its use, in detail. 4. Explain Virtual function with an example. 5. Briefly explain about i)array of pointer ii)pointer to a function iii)pointer to object iv)this pointer 6. Write a note on Exception handling. 7.Explain about class and function templates? 8.Explain the classes for file stream operations. 9. Explain the working of files.
UNIT III PART-A 1. What is an algorithm? Give example 2. What is datastructure? what are its type. 3. What is a stack? 4. Write about Queue datastructure? 5. What are the various types of Linked list? 6. What are priority queues? 7. Define binary heap? 8. Define hashing? 9. What are the applications of binary heaps? 10. Write about heap order property and structure propery. 11.What is a skew heap? 12.Write about leftist heaps. PART-B 1. (i) Explain the insertion and deletion operation in Stacks (ii) Describe the various applications of stack 2. Describe Queue and its operation with suitable eg. 3. Explain about Linked list, its Types,insertion and deletion routines with suitable egs. 4. (i) Briefly explain priority queues (ii)briefly explain about binary heaps and its application. 5. (i) Explain significance of Hashing. (ii)explain about various types of hashing. UNIT-IV PART A 1. Define a tree? 2. Define a binary tree? 3. Give the three types of traversals. 4. Define AVL tree. 5. What is a Graph? Give example. 6. What is a minimum spanning tree? 7. Give the list representation of Graph? 8. What are undecidable and recursively undecidable problem? 9. What is meant by traveling salesman problem? 10. What is NP-completeness? 1. Write notes on i) Implementation of Binary tree. ii) Expression tree. 2. Explain search tree ADT. Part-B 3. Discuss AVL trees with example. 4. i)write in detail about topological sort. ii) Explain Dijkstra s algorithm with example. 5. i)discuss about single source shortest path problem? ii) Discuss about Unweighted shortest path problem? 6. Explain a simple maximum flow algorithm in detail. 7. Explain NP-Completeness problem with suitable example. 8. Explain Prim s Algorithm with Example? 9. Explain Kruskal s Algorithm with Example?
UNIT-V PART-A 1. What is sorting? what are its type. 2. What is the difference between internal & external sorting? 3. Give example for Bucket Sort? 4. What is multimerging? 5. What is meant by divide and conquer technique? 6. What is Optimal binary search tree? 7. Mention about insertion sort 8. State the role of pivot element in quick sort. 9. Give examples for internal & external sorting? 10. Describe about dynamic programming. Part-B 1. i)explain insertion sort with example. ii)write a note on shell sort with example. 2. i)discuss briefly about heap sort with example ii)explain Merge sort with Example. 3. Explain Quick sort in detail with an eg. 4. Explain Greedy algorithm with an example. 5. Explain about All pair shortest path algorithm. 6. Explain about Divide and Conquer technique in detail with an example.
B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER 2010 Third Semester Electronics and Communication Engineering EC 2202 DATA STRUCTURES AND OBJECT ORIENTED PROGRAMMING IN C++ (Regulation 2008) Time : Three hours Maximum : 100 Marks Answer ALL questions PART A (10 2 = 20 Marks) 1. What effects do the visibility labels private, protected and public have on the members of a class? 2. What are the advantages of operator overloading? 3. What is inheritance? What are its advantages? 4. Define virtual function. 5. Define stack. Mention the operations on stack. 6. What is binary heap? What are its types? 7. What is meant by an adjacency matrix? 8. State the properties of binary search tree. 9. What is sorting? How is sorting essential for data base applications? 10. What is meant by dynamic programming? PART B (5 16 = 80 Marks) 11. (a) (i) Compare and contrast Structured Programming and Object iented Programming. (8) (ii) Distinguish between Data Encapsulation and Data Abstraction. (4) (iii) Mention the purpose of Constructor and Destructor functions. (4) (b) (i) Explain the control structures of C++ with suitable examples. (12) (ii) Define function overloading with a simple example. (4) 12. (a) (i) Differentiate inheritance from polymorphism. (6) (ii) Write a C++ program to illustrate the concept of hierarchical inheritance. (10) (b) (i) What is the use of template? Write an overloaded function template called max( ), which will find the maximum of any two given integers. (8) (ii) Explain the exception handling mechanism of C++ in detail. (8) 13. (a) (i) Explain the operations performed on queue in detail. Write a C++ program to implement
these queue operations. (10) (ii) Explain insertion, deletion and replacement of nodes in a heap. (6) (b) (i) What are the advantages of linked list over array? (4) (ii) Define Hashing. (2) (iii) Write a C++ program to implement stack through linked list. (10) 14. (a) (i) Write an algorithm to traverse binary tree level by level, with each level of the tree being traversed from left to right. (10) (ii) Explain spanning tree and minimal spanning tree with examples.(6) (b) (i) Define AVL tree. Explain the operations on AVL tree with illustrations. (6) (ii) Explain breadth first search algorithm for the traversal of any graph with suitable examples. Define time complexity of the algorithm. (10) 15. (a) (i) Explain heap sort with an illustration. (8) (ii) Explain the greedy algorithm to find minimum spanning tree. (8) (b) (i) Explain the insertion sort with its time complexity. (8) (ii) Explain as to how divide and conquer technique can be applied for merge sort. (8)
B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER 2011 Third Semester Electronics and Communication Engineering EC 2202 DATA STRUCTURES AND OBJECT ORIENTED PROGRAMMING IN C++ (Regulation 2008) Time : Three hours Maximum : 100 Marks Answer ALL questions PART A (10 2 = 20 Marks) 1. Define polymorphism 2. What is the use of construction? 3. List the different types of inheritance supported in C++. 4. Define pointers. 5. What are the disadvantages of DLL over SLL? 6. What is hashing? 7. Define binary tree with example. 8. What is meant by weighted graph? 9. Write the program for insertion sort. 10. Define shell sort. PART B (5 16 = 80 Marks) 11. (a) Explain in detail about classes and objects with example. (16) (b) With general syntax and example describe the operating overloading for unary and binary operators in detail. (16) 12. (a) Describe in detail about virtual classes and abstract classes. (16) (b) (i) Write short notes on virtual functions. (8) (ii) Differentiate Static polymorphism and Dynamic polymorphism. (8) 13. (a) Explain the Basic operations to performed on linked lists in details. (16) (b) Explain stack ADT in detail with suitable examples and general syntax. (16) 14. (a) Describe in detail about the shortest path algotith. (16) (b) Explain Prim s algorithm in detail with proper example. (16) 15. (a) Explain in detail about merge sort and quick sort with examples. (16) (b) Write short notes on (i) Greedy algorithm (8) (ii) Divide and Conquer algorithm (8)