Question Bank - i to v- Part a and Part B-1

7
VELAMMAL INSTITUTE OF TECHNOLGY DEPARTMENT OF INFORMATION TECHNOLOGY Staff Name: P.Sailaja Sub code: EC6301 Sub Name: OBJECT ORIENTED PROGRAMMING AND DATA STRUCTURES Degree /Branch: B.E / ECE Year/Sem : II yr/ III Sem QUESTION BANK UNIT I (PART B ) 1. Compare and contrast structure oriented and object oriented programming? 8m Dec 10,6 m may 13 2. Or comaparision of conventional programming and oops ? 6m Jun-13 3. Distinguish between data abstraction and data encapsulation ? 4m Dec 10 4. Mention the purpose of constructors and destructors? 16m May 10 , 4 May 2013 Or 5. Illustrate the use of copy constructor and function overloading with c++ program?16 Dec 11 Or 6. Write a c++ program to define overloaded constructor and to perform string initialization and string copy. 11M Dec 11 Or 7. Define copy constructor and dynamic constructor what are the different ways of writing copy constructor? 6m May 11 Or 8. Explain with examples types of constructors? 16m Dec 2013 9. Where to use friend function in binary operator overloading? How Explain with an example10MMay 11 10. Write a c++ program that contains a class string and overloads the following operators on strings? 16m Dec 2013 + - to concatenate two strings - - to delete substring from given string = - to check equivalence of both strings 11. what is operator overloading? Overload the numerical operators +,/ and * for complex numbers addition ,division and multiplication? 16M Dec 12, 6 m May 2013 or 12. Write a menu driven program to accept 2 integers and an operator (+,-,*, %,/) and to perform the operation and print the result? 16m Dec 2012 Or 13. Where to use friend function in binary operator overloading ?how? Explain with an example ? 10 M May 11 14. Explain about inline function? 8m May-10 15. Explain Function Overloading with suitable example? 4m Dec 10, 4m May 2013 16. Explain the merits and demerits of object oriented paradigm ?6m Dec 11 17. Explain about Type conversions? 8m Dec 09 18. Explain about Call by value and Call by Reference. 6 M May-11 19. What is a Friend function? What is the use of using Friend functions in c++ ?Explain with suitable program. 8m May-10 20. Define a class string .use overload ‘==’ operator to compare two strings? 8m Dec 09 21. Write a C++ program to assign ‘n’ projects to ‘m’ programmers based on the skill set of programmers using friend function. Use static variable to count total number of assignments.10 M May-11 22. Explain the control structures of C++ with suitable example? 12M may 2013 23. What is structure explain members of a structure with an example? or 24. Differentiate between structure and class with syntax and example program? 25. What are the advantages of using default arguments with example program? 26. Explain static member and this pointer with an example? 27. What is proxy class explain with an example ? 28. Explain container classes and itegrators with example programs like vector, list and map? 29. What is operator overloading ? overload unary operator -(Minus) , and + +(increment) or - -( decrement) with programs?

Transcript of Question Bank - i to v- Part a and Part B-1

Page 1: Question Bank - i to v- Part a and Part B-1

VELAMMAL INSTITUTE OF TECHNOLGY DEPARTMENT OF INFORMATION TECHNOLOGY

Staff Name: P.Sailaja Sub code: EC6301 Sub Name: OBJECT ORIENTED PROGRAMMING AND DATA STRUCTURES Degree /Branch: B.E / ECE Year/Sem : II yr/ III Sem

QUESTION BANK

UNIT I (PART B )

1. Compare and contrast structure oriented and object oriented programming? 8m Dec 10,6

m may 13

2. Or comaparision of conventional programming and oops ? 6m Jun-13

3. Distinguish between data abstraction and data encapsulation ? 4m Dec 10

4. Mention the purpose of constructors and destructors? 16m May 10 , 4 May 2013

Or

5. Illustrate the use of copy constructor and function overloading with c++ program?16 Dec 11

Or

6. Write a c++ program to define overloaded constructor and to perform string initialization and

string copy. 11M Dec 11

Or

7. Define copy constructor and dynamic constructor what are the different ways of writing copy

constructor? 6m May 11

Or

8. Explain with examples types of constructors? 16m Dec 2013

9. Where to use friend function in binary operator overloading? How Explain with an

example10MMay 11

10. Write a c++ program that contains a class string and overloads the following operators on

strings? 16m Dec 2013

+ - to concatenate two strings

- - to delete substring from given string

= - to check equivalence of both strings

11. what is operator overloading? Overload the numerical operators +,/ and * for complex

numbers addition ,division and multiplication? 16M Dec 12, 6 m May 2013

or

12. Write a menu driven program to accept 2 integers and an operator (+,-,*, %,/) and to perform the

operation and print the result? 16m Dec 2012

Or

13. Where to use friend function in binary operator overloading ?how? Explain with an

example ? 10 M May 11

14. Explain about inline function? 8m May-10

15. Explain Function Overloading with suitable example? 4m Dec 10, 4m May 2013

16. Explain the merits and demerits of object oriented paradigm ?6m Dec 11

17. Explain about Type conversions? 8m Dec 09

18. Explain about Call by value and Call by Reference. 6 M May-11

19. What is a Friend function? What is the use of using Friend functions in c++ ?Explain with

suitable program. 8m May-10

20. Define a class string .use overload ‘==’ operator to compare two strings? 8m Dec 09

21. Write a C++ program to assign ‘n’ projects to ‘m’ programmers based on the skill set of

programmers using friend function. Use static variable to count total number of assignments.10

M May-11

22. Explain the control structures of C++ with suitable example? 12M may 2013

23. What is structure explain members of a structure with an example? or

24. Differentiate between structure and class with syntax and example program?

25. What are the advantages of using default arguments with example program?

26. Explain static member and this pointer with an example?

27. What is proxy class explain with an example ?

28. Explain container classes and itegrators with example programs like vector, list and map?

29. What is operator overloading ? overload unary operator -(Minus) , and + +(increment) or -

-( decrement) with programs?

Page 2: Question Bank - i to v- Part a and Part B-1

VELAMMAL INSTITUTE OF TECHNOLGY DEPARTMENT OF INFORMATION TECHNOLOGY

Staff Name: P.Sailaja Sub code: EC6301 Sub Name: OBJECT ORIENTED PROGRAMMING AND DATA STRUCTURES Degree /Branch: B.E / ECE Year/Sem : II yr/ III Sem

UNIT II PART B

1. Write a c++ program to illustrate the concept of hierarchical inheritance? 10M Dec-10

2. What are the different forms of inheritance supported in c++? Explain with an example. Like vehicle 16M Dec 11 , Dec 2013 16M

3. Explain protected , private and public inheritance ?8m may 2013 4. Write a c++ program to solve 8 queens problem with friend function? 8m May 2013

5. Write a example program for pure virtual function and virtual function with suitable algorithms?

16 May 2013

6. Define inheritance? What is polymorphism? 6m Dec 2010 Dec 2012

7. Explain in detail about multiple inheritances with an example. 10m Dec 2010 Dec 2012

8. Explain in detail about Virtual function and polymorphism with example. Or Runtime

polymorphism 8m Dec 2011

9. Explain the operators used for dynamic memory allocation with example? 8m May 10

10. Write a c++ program to define a class patient (name,age,sex) Derive two classes from patient

namely in -patient (ipno,dateof-adm,date-of_discharge) and ‘out-patient’(opno,doctor-

id,consulation_fee) Define two classes namely ‘general-ward’ (rent/day) ‘special-ward’

(roomno,rent/day,ebbill) for out-patient print the bill with consulation –fee .For in-patients

print bill according to their accommodation either in general –ward or special ward? 16m

may 2011

11. Explain the need for pure virtual functions. (4) [NOV/DEC 2009]

12. Write a C++ program for calculating the area of rectangle and circle using run-time

polymorphism. [NOV/DEC 2009]

13. What are abstract classes? Write a program having student as an abstract class and create many

derived classes such as engineering, science, medical etc., from the student class. Create their

object and process them. (Marks 16) [APRIL/MAY 2010]

14. Consider an example of book shop which sells book and video tapes. These two classes are

inherited from the base class called media. The media class has command data members such as

title and publication. The book class has data members for storing number

15. Narrate type conversion with example QB

16. What is virtual destructor? Explain the use of it?

17. Write a brief note on casting class pointers and member functions ?

18. Explain about Composition vs inheritance? 8M

19. Explain abstract base classes and concrete classes? 8M

20. Explain constructors and destructors in derived classes?

21. Explain about this pointer? 8M

UNIT III PART B

1. Explain the linked list implementation of stack ADT in detail? Dec 2010 10M Dec 2012 16M

May 2010 10m

2. What is a Queue? Explain its operation with c++ example program? Dec 2010 10M, May 2013 8m

3. Explain the linked list implementation of list ADT in Detail? May 2011 8M

4. Write algorithms to insert an element into stack and a queue. Can stack be used for recursion?

Justify your answer? May 2011 10M

5. What are the advantages of linked list when compare to arrays? 4M Dec 2010

6. Convert the expression ((A+B) *C –(D-E)^(F+G)) to equivalent prefix and post fix notations? May

2010 6M or

Convert the given expression into post fix and evaluate with given values and write routine for

conversion and evaluation process?

7. Explain how linked list will be useful for polynomial manipulations with routine? 16M

QB

UNIT IV PARTB

1. What is a Binary tree? Explain the different tree traversals with an application? 16M June

2014 (or)

Traverse the tree given below using inorder , preorder and post order traversals? May 2010 16M

Page 3: Question Bank - i to v- Part a and Part B-1

VELAMMAL INSTITUTE OF TECHNOLGY DEPARTMENT OF INFORMATION TECHNOLOGY

Staff Name: P.Sailaja Sub code: EC6301 Sub Name: OBJECT ORIENTED PROGRAMMING AND DATA STRUCTURES Degree /Branch: B.E / ECE Year/Sem : II yr/ III Sem

2. Explain Depth first and breadth first traversal with algorithm, routine and example? 16M

Or compare BFS and DFS ? OR Explain about graph traversal with algorithm , routine and

example with implementation?

3. Represent the following graph using 8M

Find the adjacency matrix and adjacency list for the graph? June 2014

4. Explain smart union algorithm with an example? 16M

Or explain dynamic equivalence problem with routine? 16M

5. Explain the representation of tree with an example? 8M

6. Short notes on path compression? 6M

7. What is union by height in a tree explain with example and routine? 8m

8. What is union by size in a tree explain with example and routine? 8m

UNIT V PART B

1. Explain Insertion sort algorithm with example and program? Explain its algorithm

analysis?

2. Explain merge sort algorithm with example and program? Explain its algorithm analysis?

3. Explain quick sort algorithm with example and program? Explain its algorithm analysis?

4. Explain linear search algorithm with example and program? Explain its algorithm

analysis?

5. Explain binary search algorithm with example and program? Explain its algorithm analysis?

6. Explain how divide and conquer technique is applicable for merge sort? May 2013 16m

7. Sort the given elements using quick sort and estimate its time and space complexity?

65 70 75 80 60 55 50 45

Illustrate each step of the sorting process? Dec 2013

8. Explain the algorithm of quick sort by sorting the following set of numbers as an examle. 42, 47,

52, 62, 37, 32, 27, 22 May 2010

9. Explain how divide and conquer is applied to merge sort. Trace the algorithm for the follwing set

of data 25,0,8,78,6,34,56,90,100 June 2012

UNIT I (PART A)

1. Define class and objects ? May 2013

2. Define inline and friend function? May 2013

3. What is data encapsulation give an example? Dec 2013

4. How to declare member of a class static? Dec 2013

5. When do we declare a member of a class static? Dec 2009

6. How is a class declared in C++? May 2010

7. What are the advantages of operator overloading? Dec 2010

8. Define encapsulation. Dec 2011

9. Highlight the advantages of static data member and static function in C++. June 2012

10. What is constructor? Dec 2012

11. Define Destructor?

12. Why is it necessary to overload an operator? Dec 2009

13. What is a scope resolution operator and how it can be used for global variable? May 2010

14. What are the advantages of using new operator as compared to malloc ()? May 2011

15. Mention the operators that cannot be overloaded. June 2012

16. Give general form of operator function? Dec 2010

17. What is a default constructor? Dec 2011

Page 4: Question Bank - i to v- Part a and Part B-1

VELAMMAL INSTITUTE OF TECHNOLGY DEPARTMENT OF INFORMATION TECHNOLOGY

Staff Name: P.Sailaja Sub code: EC6301 Sub Name: OBJECT ORIENTED PROGRAMMING AND DATA STRUCTURES Degree /Branch: B.E / ECE Year/Sem : II yr/ III Sem

18. Write the properties of a static member function. Dec 2012

19. How pointer is implemented in C++? May 2010

20. What does this pointer point to? Dec 2009

21. what is an inline function ? QB

22. Write some situations where inline expansion may not work

23. what is a default argument ?

24. Write some properties of friend functions.

25. What is the purpose of using operator function? Write its syntax.

26. What is meant by binding? Apr/May 2010

27. What are the types of type conversions?

28. What are the control structures used in C++?

29. State the difference between structures and class.

30. List the access modes used within a class.

31. What are the characteristics of member functions?

32. What are the properties of a static data member?

33. What are the properties of a static member function?

34. How can objects be used as function arguments?

35. List some of the special cha racteristics of constructor.

36. Give the various types of constructors.

37. What are the ways in which a constructor can be called?

38. List some of the special characteristics of constructor.

UNIT II (PART A)

1. What is inheritance? May 2013

2. Define recursion and specify the datastructures used to perform recursion? Dec 2013

3. What is the use of virtual functions in c++? Dec 2013

4. What does multiple inheritance mean? Dec 2012

5. Define pure virtual function and mention its usage. June 2012

6. What is an abstract class? Dec 2009

7. What is a virtual base class? QB

8. What is a pure virtual function?

9. How can a private member be made inheritable?

10. What effects do the visibility labels private, protected, and public have on the members of a

class? Dec 2010

11. What are the advantages of inheritance?

12. What is meant by binding? May 2010

13. What are the advantages of inheritance?

14. What are types of polymorphism?

15. Define single, multiple, multi level , hierarchical and hybrid inheritance?

16. Define this pointer?

17. How can a private me mber be ma de inheritable?

18. Write types of conversions?

19. Write syntax of constructor in derived classes?

20. Define virtual Destrcutor?

21. Define composition?

22. Define Concrete classes?

23. Write syntax of casting of class pointer and member functions?

Page 5: Question Bank - i to v- Part a and Part B-1

VELAMMAL INSTITUTE OF TECHNOLGY DEPARTMENT OF INFORMATION TECHNOLOGY

Staff Name: P.Sailaja Sub code: EC6301 Sub Name: OBJECT ORIENTED PROGRAMMING AND DATA STRUCTURES Degree /Branch: B.E / ECE Year/Sem : II yr/ III Sem

UNIT III (PART A)

1. Write down the definition of data structures?

2. Give few examples for data structures?

3. Define Algorithm?

4. What are the features of an efficient algorithm?

5. List down any four applications of data structures?

6. What do you mean by primitive data structure?

7. What is an Abstract Data type(ADT)? Explain?

8. What are the operations of ADT?

9. What is meant by list ADT?

10. What are the various operations done under list ADT?

11. What are the two parts of ADT?

12. Why is linked list used for polynomial arithmetic? Apr /May 2012

13. Write postfix from of the expression –A+B-C+D ? QB

14. Give the expression tree for (a+b) *((c+d *e) *f)? June 2014

15. What are the postfix and prefix forms A+B*(C-D)/(P-R) of the expression

16. State the demerits of linked list representation of binary trees?

17. What is Dequeue? May 2013

18. What is priority queue? Dec 2013

19. What are the representations of Big and Small ‘O’ notations? May 2010

20. What is the advantage of using doubly linked list over single linked list? May 2011

21. What is an ADT?

22. Write any two data structures used in operating systems. May 2010

23. Define Stack. Mention its operations Dec 2010

24. Mention the applications of stack. May 2010

25. Write down the definition of data structures?

26. What is a doubly linked list?

27. What is circular linked list?

28. Define stack?

29. Define queue?

30. What are the advantages of linked list when compare to arrays? Dec 2010

31. What is the need for the header?

32. How do you test for an empty queue?

UNIT IV(PART A)

1. How many trees are possible with 3 nodes? May 2009,2010

2. What is meant by indegree and outdegree of a vertex? Qb

3. Does the minimum spanning tree of a graph gives the shortest between any two specific

nodes? Justify? May 2013, Dec 2013

4. When does a graph become tree? Nov 2009

5. What is meant by adjacency matrix? Nov 2010

6. Define minimum spanning tree? May 2011

7. Define strictly binary tree?

8. Define complete binary tree?

9. Define connected graph?

10. Define complete graph?

11. Define minimum spanning tree?

12. Applications of spanning tree?

13. What is degree of a graph? Nov 2011

14. What is binary tree? give an example? Dec 2013

15. List the properties of equivalence relation? June 2014

16. Compare general tree, binary tree and binary search tree?

17. List applications of DFS and BFS?

18. List applications of trees and binary trees?

19. What is meant by biconnected component?

20. Define articulation point?

Page 6: Question Bank - i to v- Part a and Part B-1

VELAMMAL INSTITUTE OF TECHNOLGY DEPARTMENT OF INFORMATION TECHNOLOGY

Staff Name: P.Sailaja Sub code: EC6301 Sub Name: OBJECT ORIENTED PROGRAMMING AND DATA STRUCTURES Degree /Branch: B.E / ECE Year/Sem : II yr/ III Sem

21. Define graph?

22. Define Tree?

23. State the merits of linear representation of binary trees?

24. What do you meant by undirected graph?

25. What do you meant by cyclic graph?

26. When a graph is called biconnected?

27. Explain spanning and minimum spanning tree with example? Dec 2010

28. State the properties of binary search tree. Dec 2010

29. When does a binary tree become binary search tree?

30. Define non-linear data structure?

31. Define leaf?

32. What is meant by directed tree?

33. What is a ordered tree?

34. What are the applications of binary tree?

35. What is meant by traversing?

36. What are the different types of traversing?

37. What are the two methods of binary tree implementation?

38. Define pre-order traversal?

39. Define post-order traversal?

40. Define in -order traversal?

41. What is the length of the path in a tree?

42. Define expression trees?

43. What is an almost complete binary tree?

44. What is the (a) maximum (b) minimum height of a binary tree with 15 nodes?

45. Define adjacent nodes?

46. What is a directed graph?

47. What is a undirected graph?

48. What is a loop?

49. What is a simple graph?

50. What is a weighted graph?

51. Define out degree of a graph?

52. Define indegree of a graph?

53. Define path in a graph?

54. What is a simple path?

55. What is a cycle or a circuit?

56. What is an acyclic graph?

57. What is meant by strongly connected in a graph?

58. When is a graph said to be weakly connected?

59. Name the different ways of representing a graph?

60. What is an undirected acyclic graph?

61. What are the two traversal strategies used in traversing a graph?

62. What is a forest?

63. Name two algorithms two find minimum spanning tree

64. Draw an undirected graph with 6 vertices, 9 edges, 2 loops.

65. . Draw a digraph with 5 vertices, 8 edges, and path between every pair of vertices.

66. Define non terminal node?

67. Define terminal or leaf?

68. Define sibling.

69. Define path in a graph?

70. What is a simple path?

Page 7: Question Bank - i to v- Part a and Part B-1

VELAMMAL INSTITUTE OF TECHNOLGY DEPARTMENT OF INFORMATION TECHNOLOGY

Staff Name: P.Sailaja Sub code: EC6301 Sub Name: OBJECT ORIENTED PROGRAMMING AND DATA STRUCTURES Degree /Branch: B.E / ECE Year/Sem : II yr/ III Sem

UNIT V

PART A

1. What is the best way of choosing the pivot element in quick sort?

2. What are the various factors to be considered in deciding a sorting algorithm?

3. What is meant by internal and external sorting?

4. How many passes are required for k-way merging?

5. Define Divide and Conquer algorithm

6. What is the worst case and best case time complexity of binary tree sort?

7. List any 4 types of sorting techniques? May 2013

8. How data is sorted in queue structure? May 2013

9. State and verify why quick sort is efficient than merge sort? Dec 2013

10. What is meant by sorting?

11. What are the two main classifications of sorting based on the source of data?

12. What is meant by external sorting?

13. What is meant by internal sorting?

14. What are the various factors to be considered in deciding a sorting algorithm?

15. What is the main idea behind insertion sort?

16. Give advantage of merge sort?

17. List linear search and binary search with example

18. Differentiate linear search and binary search.

19. Differentiate quick sort and merge

20. Give the advantage of merge sort

21. Distinguish quick sort and insertion sort.

22. Define sorting.