Click here to load reader
Upload
lamdat
View
215
Download
3
Embed Size (px)
Citation preview
5105-Bharathidasan Engineering College
1
Prepared By: Ms.S.Kanimozhi, AP/IT
BHARATHIDASAN ENGINEERING COLLEGE
NATTRAMPALLI – 635 854.
Department of ECE
Subject Code/Name: EC6301 / OOPS & DS
Year/Sem: II Year/ III Sem
FAQ
UNIT- I
PART-A (2 MARKS)
1. Write a C++ code to swap values of two variable using reference variables in
function. Nov-2014
2. Write a C++ code to display “pen object instantiated” and “pen object destroyed”
when class for pen constructor and destructor are called. Nov-2014
3. What is a reference variable? April-2015
4. Define friend function. April-2015, Nov-2015
5. Define constructor. List the type of constructor? May/June 2016
6. What is destructor? Nov-2015
7. What is meant by default constructor? Nov-2016
8. Difference between class and structure. April -2010, Dec-2012, Nov-2016
9. List the benefits of using static class data. Give an example of a class with static
members. April-2017
10. What operation is performed when the default assignment operator = is applied to
objects? April-2017
11. What is data hiding? April -2011,Nov-2010
12. What is abstract class? Nov-2009
13. Define polymorphism. Apr 2013
14. What is function prototype? Dec 2011
15. List any four operators that cannot be overloaded. Dec 2010,Dec 2009,Dec 2011,
May/June 2016 16. What is the use of scope resolution operator?
17. Define constructor with an example.
18. What is object oriented programming? How is it different form the procedure
oriented programming? May/June 2006
19. What are the main characteristics of OOP language? May/June 2007
20. What are the operators that cannot be overloaded only by friend function? Nov/2005
21. Write down the types of constructor.
22. What is meant by dynamic memory allocation?
23. What are the access specifier presented in C++? Nov / 2010
24. Define function overloading.
25. Define operator overloading.
5105-Bharathidasan Engineering College
2
Prepared By: Ms.S.Kanimozhi, AP/IT
26. Write any four rules for operator overloading.
27. Define static data members.
28. Write any four properties of constructor. Dec 2010
29. What are the difference between default and parameterized constructors? May/2006
30. How is a member function of a class defined?
31. What is the difference between call by value and call by reference?
32. Define default argument.
PART-B (16 MARKS)
1. Write a member function and friend function to subtract two complex numbers in
C++.(16) Nov - 2014
2. Write a member function to perform matrix addition, simple addition and string
concatenation by overloading + operator. (16) Nov - 2014
3. Describe the major components of object oriented programming with illustration.
(16) April-2015, Nov-2016
4. What is the purpose of constructor and destructor? Explain with suitable example
the different types of constructors in C++? (16) April-2015
5. Narrate on parameterized constructor and copy constructor with an example for
each of them. (16) Nov-2015
6. i) What do you mean by function overloading and explain it with an example? (8)
ii) Elaborate on binary operator overloading with an example. (8) Nov-2015
7. Discuss about function overloading with varying number of arguments and data
types. (16) May/June 2016
8. i) List the characteristics of friend function. (4) May/June 2016
ii) Write short notes of destructor. (4) May/June 2016
iii)Explain in detail about static class member with employee class program.(8)
9. Write a program for swapping two numbers using friend function. (6) Nov-2016
10. Write a program to find the area of rectangle and triangle using function
overloading. (7) Nov-2016
11. Implement the ATM transaction in C++. (15) Nov-2016
12. What is function overloading? Explain with example. Why it is important?(6)
April-2017 13. Write a program in C++ using friend function to find the product of two complex
numbers. (7) April-2017
14. What is a container? Explain the types of sequence containers with examples. (7)
April-2017
15. Write a program in C++ to demonstrate the addition of two complex numbers by
overloading + operator. (6) April-2017
16. What are the difference between reference variable and normal variables?
17. Explain in detail the following.
i) Static class members.
ii) Proxy classes
5105-Bharathidasan Engineering College
3
Prepared By: Ms.S.Kanimozhi, AP/IT
18. i) Where to use friend function in binary operator overloading? How? Explain with
an example? (10)
ii) Explain the merits and demerits of object oriented paradigm (6)
19. i) Explain about Call by value and Call by Reference. (8)
ii) Explain in detail about the types of container classes. (8)
20. Write a program to implement constructor and destructor.
21. What is a proxy class and explain container classes and integrators?
UNIT-II
PART-A (2 MARKS)
1. Write a C++ code to display as area of square or rectangle using function
overriding. Nov-2014
2. Write a sample to code to show the usage of this pointer in C++. Nov-2014
3. What is overriding? April-2015
4. Why there is need for operator overloading? April-2015
5. Differentiate private and protected members of a class. Nov-2015
6. What is dynamic binding? Nov-2015
7. Write a simple C++ program to demonstrate the virtual functions. May/June 2016
8. State about cast operator. May/June 2016
9. What is the role of this pointer? Nov-2016
10. Define virtual function. Nov-2016
11. When is the protected access specifier used in a class? April-2017
12. State the purpose of virtual base classes. April-2017
13. Differentiate void and null pointers.
14. What is virtual base class?
15. What is meant by virtual function?
16. Difference between static and dynamic binding.
17. What are the difference forms of inheritance?
18. What is an I/O stream? Nov/Dec 2007
19. What is the type of class for which object cannot be created? Nov/Dec 2007
20. Define function overriding.
21. Difference between composition vs inheritance.
22. Write down the types of polymorphism.
23. What is mean by pure virtual function?
24. Define pointers.
25. Difference between pointers and arrays.
26. What is unique about ‘this’ pointer? Nov/Dec 2005
27. Differentiate overloading and overriding. Nov/Dec 2005
28. What does polymorphism mean in C++ language?
29. Differentiate public, private and protected inheritance.
30. Difference between static and dynamic binding.
31. Differentiate between abstract and concrete class.
32. Define casting class pointers.
5105-Bharathidasan Engineering College
4
Prepared By: Ms.S.Kanimozhi, AP/IT
33. What is meant by virtual destructors?
PART-B (16 MARKS)
1. Write a C++ code to construct classes of a person with name and age as public
properties, account details as private properties and percentage of mark as protected
property. Construct a class with sports details of person. Construct a class to rank
person based on the equal weightage to academic and sports details. Use inheritance
concept. (16) Nov - 2014
2. Explain class object to base and base to class object conversions using C++ with
suitable example. (16) Nov - 2014
3. What is inheritance? Discuss in detail about the various types of inheritances in C++
with suitable examples. (16) April-2015
4. What is virtual function? Explain with an example how late binding is achieved
using virtual function. (16) April-2015
5. i) Explain base and derived classes with examples. (8) Nov-2015
ii) Write a program to illustrate how constructors are implemented when the classes
are inherited? (8) Nov-2015
6. i) Given an account on virtual functions with an example. (8) Nov-2015
ii) Write a note on ‘this’ pointer with an example. (8) Nov-2015
7. Consider the class network of the figure. (16) May/June 2016
8. Explain the polymorphism with example. (16) May/June 2016
9. Explain the concept of composition with example. (13) Nov-2016
10. Describe the types of inheritance in C++ with an example. (13) Nov-2016
11. Define an abstract class called Employee. Derive two classes called hourly
employee and salaried employee. Hourly employee has number of hours (integer), and
wage per hour (float).
Salaried employee has salary of type float. Calculate salary() in an abstract function
in class employee which inherited by derived classes. Write a main program to create
objects of all classes and calculate salary of each object. (15) Nov-2016
12. Demonstrate the order of invocation and execution of constructors and destructors
in multi-level inheritance with an example. (7) April-2017
13. Explain overriding of member functions with an example. (6) April-2017
14. Write a C++ program to find the area of a rectangle and a triangle using virtual
functions. (8) April-2017
15. Demonstrate with an example, how a member function can find out the address of
the object to which it belongs using this pointer. (5) April-2017
16. What is an abstract class? Write a program for testing the debuggable class.
17. What is the difference between a normal virtual function and pure virtual function
with example?
18. Explain about virtual functions in C++.
19. What is a virtual function? When do we make a virtual function “pure”. Illustrate
with a necessary C++ program.
5105-Bharathidasan Engineering College
5
Prepared By: Ms.S.Kanimozhi, AP/IT
20. What are the different forms of inheritance supported in C++? Discuss on the
visibility of base class members in privately and publicly inherited classes.
21. Differentiate inheritance and polymorphism? Write a C++ program to illustrate
inheritance.
22. Explain the concept of abstract classes and concrete classes.
UNIT-III
PART-A (2 MARKS)
1. Evaluate the value of expression ab+c*d using stack. Nov-2014
2. Find the maximum number of nodes in complete binary tree if d is the depth. Nov-
2014 3. What is ADT? April-2015, Nov-2015
4. Write short notes on queue. April-2015
5. What do you mean by queue ADT? Nov-2015
6. Convert the infix expression a+b*c+(d*e+f)*g into postfix. May/June 2016
7. Define sentinel nodes, header node and tail node. May/June 2016
8. Define data structure. How it is classified? Nov-2012, Nov-2016
9. List the application of linked lists. Nov-2016
10. Write a procedure to insert an element in the beginning of a list ADT implemented
using singly linked list. April-2017
11. List the advantages in the linked list implementation of stack. April-2017
12. Differentiate between stack and queue?
13. Differentiate between linear and non linear data structure.
14. What is an algorithm?
15. State the difference between arrays and linked list.
16. What notation is used to specify the complexity of an algorithm?
17. Convert the infix expression to postfix. (a+b^c^d)*(e+d/d)
18. What is a Priority Queue? Nov/Dec 2010
19. What is meant by list ADT?
20. What is stack? Nov/Dec 2008
21. Define a list. Mention any 2 operations that are performed on a list.
22. Define dequeue.
23. What are the basic operations of stack?
24. Convert the infix expression (a*b)+((c*g)-(e/f)) to its equivalent polish and reverse
polish expression.
25. State the difference between arrays and linked lists.
26. State the difference between queue and linked lists.
27. What is circular queue?
28. Convert the infix expression a+b*c+(d*e+f)*g to its equivalent postfix expression
and prefix expression.
29. Write a routine to return the top element of stack.
30. Write a routing to check IsEmpty and IsLast for queue.
31. Write a procedure to insert an element in a singly linked list.
5105-Bharathidasan Engineering College
6
Prepared By: Ms.S.Kanimozhi, AP/IT
32. Compare LIFO and FIFO. Apr/May 2015
33. Convert the infix expression a*b/c+d to its equivalent postfix expression. Apr/2011
34. List out the applications of stack. Apr/2011
35. Evaluate the following postfix expression using stack. 862+*431-/-Apr /May 2014
36. What is singly linked list? Apr /May 2014
37. What is doubly linked list? Give its advantage. Apr /May 2014
PART-B (16 MARKS)
1. Write a C++ code to sum up all odd numbers in a single link list. (16) Nov - 2014
2. Write a C++ code to perform addition of two polynomials using link list form of
queue. (16) Nov - 2014
3. Write a set of routines for implementing queue using linked list. (16) April-2015
4. Write a set of routines for implementing two stacks within a single array. (16)April-
2015 5. i) Write a note on singly linked lists. (8) Nov-2015
ii) Explain list ADT. (8) Nov-2015
6. Explain the applications of stack in detail. (16) Nov-2015
7. i) Write the ADT operation for insertion and deletion routing in stack. (8)
May/June 2016 ii) Explain the process of conversion from infix expression to postfix using stack.(8)
8. Discuss about addition of two polynomials using linked list with necessary ADT.
(16) May/June 2016
9. Implement insertion, deletion and search operations in single linked list.(13)Nov-
2016
10. Develop an algorithm to implement Queue ADT. Give relevant examples and
diagrammatic representation. (13) Nov-2016
11. Represent two polynomials using singly linked lists and develop procedures to add
them. (6) April-2017
12. Develop algorithms to perform insertion, deletion and search operations in a queue
implemented using singly linked lists. (7) April-2017
13. Design an algorithm to convert an infix expression to postfix expression using
stacks and apply to the expression (a+b-d*e+(f*g+h)*i). (15) April-2017
14. Develop a procedures to perform push and pop operation on an array
implementation of stack and use the same to evaluate to postfix expression 1 2 3 * -
4 +. (13) April-2017
15. Give the procedure for convert an infix expression a+b*c+(d*e+f)*g to postfix
notation.
16. What is linked list? Explain with suitable program segment the operations of a
linked list.
17. Explain about polynomial in detail with an example.
18. Write the procedure for polynomial addition and differentiation?
19. Write an algorithm for inserting and deleting an element from doubly linked list?
Explain linear linked implementation of stack and queue?
5105-Bharathidasan Engineering College
7
Prepared By: Ms.S.Kanimozhi, AP/IT
20. Write the algorithm for converting infix expression to postfix expression? With an
example.
UNIT-IV
PART-A (2 MARKS)
1. Write short notes on connected components. Nov-2014
2. Give the representation of network of cities Delhi, Mumbai, Kolkata, and Chennai
as weighted graph. Nov-2014
3. What is a tree? April-2015,2014
4. How a graph is represented? April-2015
5. What is binary tree? Nov-2015
6. When graph is said to be connected? Nov-2015
7. Draw expression tree for (a+b*c)+((d*e+f)*g). May/June 2016
8. What do you mean by articulation points? May/June 2016
9. What are the two ways of representing binary tree? Nov-2016
10. Differentiate breadth first and depth first search strategies. Nov-2016
11. The inorder traversal of a binary tree resulted in E A C K F H D B G. What would
its preorder traversal return? April-2017
12. What is a graph? List the two ways to represent a graph. April-2017
13. Name the different ways of representing a graph?
14. How binary tree represented using an array? Given an example.
15. Construct an expression tree for the expression (a+b*c)+(c(d*e+f)*g).
16. What is a BST – binary search tree? Nov/ Dec 2009
17. Define graph.
18. What are difference between complete binary tree & full binary tree? Apr/ 2014
19. List the application of trees.
20. Write the difference between BFS and DFS.
21. What is meant by bi-connected component?
22. What is the time complexity of binary search tree?
23. Mention the various way representation of graph.
24. What is meant by binary tree traversal? List the different tree traversal technique.
25. Define strongly connected and weakly connected graph.
26. Comparison between general tree, binary tree and binary search tree.
27. Define union and find operation.
28. Give various implementations of trees.
29. Define adjacent nodes.
30. Write the pre-order, in-order, post-order traversal for the tree.
+
* +
A B * E
5105-Bharathidasan Engineering College
8
Prepared By: Ms.S.Kanimozhi, AP/IT
C D
31. Show the maximum number of nodes in a binary tee of height H is 2H+1-1.
32. Draw the expression tree for the expression. Nov /Dec 2011
(a+b*c)+(d+e)+f
33. Write an algorithm to declare nodes of a true structure.
PART-B (16 MARKS)
1. Explain DFS and BFS with suitable example. (16) Nov - 2014
2. Write C++ code for the implementation of different types of tree traversals. State
few tree applications. (16) Nov - 2014
3. Discuss the different methods traversing a binary tree with algorithm. (16) April-
2015 4. Illustrate the Depth First Search algorithm with a graph and explain.(16)April-2015
5. i) How can you construct an expression tree? Described your answer with an
example.(8)
ii) Discuss how sets are represented? (4)
iii) Explain union find operations? (4) Nov-2015
6. Describe in detail about breadth-fist search and depth-firs search in a graph. (16)
Nov-2015 7. Draw the binary search tree for the following input list 25, 45, 12, 60, 75, 92, 10.
Trace an algorithm to delete the nodes 25, 75, 10 from the tree.(16)May/June 2016
8. Discuss types of graph traversal and explain each with suitable examples.
May/June 2016
9. Discuss the graph traversals with suitable algorithms and examples. (13) Nov-2016
10. Explain the algorithm for union and find operations in disjoint sets. (13) Nov-2016
11. How can binary trees be represented using arrays? Write routines to perform
insertion and deletion in a tree. (7) April-2017
12. Write routines to convert a set as a tree and perform find operation on the elements.
Illustrate with examples. (6) April-2017
13. With necessary algorithms, explain the two graph traversal methods. Demonstrate
with examples. (13) April-2017
14. Design procedures to count the number of connected components and the number of
vertices in each component of a graph. Illustrate with examples. (15) April-2017
15. Draw the binary search tree for the following input list 6,2,7,1,5,3,4. And delete the
nodes 2, 7,5 from the tree.
16. Explain the operations of insertion of nodes into and deletion of nodes from, binary
search tree with code.
17. Explain in detail about connected components.
UNIT-V
PART-A (2 MARKS)
1. How to perform union operation? Nov-2014
2. What is the time complexity of quick sort and binary search? Nov-2014
5105-Bharathidasan Engineering College
9
Prepared By: Ms.S.Kanimozhi, AP/IT
3. What is meant by sorting? April-2015
4. What is time complexity? April-2015
5. How an array elements are sorted using merge sort? Nov-2015
6. With an example compute the number of comparison, required to search an element
using binary search. Nov-2015
7. List the advantages of quick sort. May/June 2016
8. Which search is faster and why? May/June 2016
9. Determine the time complexity of linear search and binary search. Nov-2016
10. Name the sorting techniques which use the divide and conquer strategy.Nov-2016
11. State the drawbacks of insertion sort. April-2017
12. Give the algorithm to search an element in an array using linear search. April-2017
13. What is the need of external sorting?
14. Define articulation points.
15. What is the time complexity of quick sort and binary search?
16. What is meant by searching?
17. List the types of sorting technique.
18. What is the time complexity of insertion sort algorithm?
19. Differentiate between internal sorting and external sorting.
20. Difference between linear search and binary search.
21. Determine the average running time of quick sort.
22. Mention some methods for choosing the pivot element in quicksort?
23. Which is the fastest sorting algorithm in practice? What is the average and worst
running time?
24. What is meant by quick sort?
25. Define merge sort?
26. Define insertion sort.
PART-B (16 MARKS)
1. Write a C++ code to implement quick sort with suitable example. Write C++ code
to implement linear search with suitable example. (16) Nov - 2014
2. Write a C++ code to implement merge sort with suitable example. Write C++ code
to implement binary search with suitable example. Nov - 2014
3. Discuss the quick sort algorithm and apply the same for the following numbers,
90,77,60,99,55,88,66. (16) April-2015
4. Explain in detail about linear search algorithm with an example. (16) April-2015
5. Explain in the detail about quick sort with an example. (16) Nov-2015
6. i) Describe binary search in detail. (8) Nov-2015
ii) Explain linear search in detail. (8) Nov-2015
7. i) Write a C++ program to implement quick sort. (8) May/June 2016
ii) Sort the sequence 4, 7, 2, 0, -8, 5 using Insertion sort. (8) May/June 2016
8. Explain the binary search with sample program. (16) May/June 2016
9. Explain the algorithm of Quick sort by sorting the following set of numbers as an
example: 42 47 52 57 62 37 38 27 22. (13) Nov-2016
5105-Bharathidasan Engineering College
10
Prepared By: Ms.S.Kanimozhi, AP/IT
10. Write the algorithm to perform binary search on an array and demonstrate with an
example. (13) Nov-2016
11. Write a recursive algorithm for quick sort and apply the same to sort the elements
12, 3, 2,26,5,21,18,25 and 50 and trace the output. (13) April-2017
12. Sort the elements 12, 3, 2, 26, 5, 21, 18, 25, and 50 using merge sort and trace the
output. (6) April-2017
13. Develop an algorithm to perform binary search on an array of elements and
demonstrate with an example. (7) April-2017
14. Explain Insertion sort with example.
15. Explain in detail about merge sort.
16. Describe the merge sort algorithm and apply for the following numbers,
23,42,89,12,71,31,9,63,25,91,54.