Dr. Bower Apostolic Junior College Dr. Bower Apostolic Junior College
Dr. Bower Apostolic Junior College Dr. Bower Apostolic Junior College
Topics: - 1) Introduction to Data Structure 2) C++ Topics: - 1) Introduction to Data Structure 2) C++
Instructions: - 1) All questions are compulsory. Instructions: - 1) All questions are compulsory.
2) Figures to the right indicate full marks. 2) Figures to the right indicate full marks.
3) Draw neat diagrams wherever necessary. 3) Draw neat diagrams wherever necessary.
4) Use of any type of calculator is not allowed. 4) Use of any type of calculator is not allowed.
5) Due credit will be given for the programs with appropriate comments. 5) Due credit will be given for the programs with appropriate comments.
Q.1 (A) Select the correct alternative and rewrite the following statements: 4 Q.1 (A) Select the correct alternative and rewrite the following statements: 4
(a) Tree is ----------- data structure. (a) Tree is ----------- data structure.
(i) Linear (ii) Non linear (i) Linear (ii) Non linear
(iii) Homogenous (iv) Non homogenous (iii) Homogenous (iv) Non homogenous
(b) Pointer is a variable that holds --------- another variable (b) Pointer is a variable that holds --------- another variable
(i) Value (ii) Memory address (i) Value (ii) Memory address
(iii) Data type (iv) None of these (iii) Data type (iv) None of these
(c) ------- operator cannot be overloaded. (c) ------- operator cannot be overloaded.
(i) Unary (ii) Binary (i) Unary (ii) Binary
(iii) Scope resolution (iv) None of these (iii) Scope resolution (iv) None of these
(a) ------- is not the feature of OOPs. (a) ------- is not the feature of OOPs.
(i) Polymorphism (ii) Inheritance (i) Polymorphism (ii) Inheritance
(iii) Data Abstraction (iv) Top-down Approach (iii) Data Abstraction (iv) Top-down Approach
(B) Answer any TWO of the following: 6 (B) Answer any TWO of the following: 6
(a) What is Data structure? Write any four different operations that can be (a) What is Data structure? Write any four different operations that can be
performed on data structured? performed on data structured?
(b) Explain stack and Queue with suitable example? (b) Explain stack and Queue with suitable example?
(c) Enlist the basic data types used in C++ with size of data in terms of bytes for (c) Enlist the basic data types used in C++ with size of data in terms of bytes for
each. each.
Q.2 (A) Answer any TWO of the following: 6 Q.2 (A) Answer any TWO of the following: 6
(a) Explain what is meant by linked list with a suitable example and a properly (a) Explain what is meant by linked list with a suitable example and a properly
labeled diagram. labeled diagram.
(b) Explain the Binary search algorithm with a suitable example. (b) Explain the Binary search algorithm with a suitable example.
(c) State any six main advantages of object oriented programming. (c) State any six main advantages of object oriented programming.
(B) Answer any ONE of the following: 4 (B) Answer any ONE of the following: 4
(a) Explain in brief with suitable diagram the following terms used in C++ (a) Explain in brief with suitable diagram the following terms used in C++
(i) Multiple Inheritance (ii) Hierarchical Inheritance (i) Multiple Inheritance (ii) Hierarchical Inheritance
(iii) Multilevel Inheritance (iv) Hybrid Inheritance. (iii) Multilevel Inheritance (iv) Hybrid Inheritance.
(b) Explain with flowcharts the following control structures: (b) Explain with flowcharts the following control structures:
(i) Sequence logic (ii) Selection logic (iii) Iteration logic (i) Sequence logic (ii) Selection logic (iii) Iteration logic
Q.3 (A) Answer any TWO of the following: 6 Q.3 (A) Answer any TWO of the following: 6
(a) Explain the following OPP concept with an example of each. (a) Explain the following OPP concept with an example of each.
(i) Polymorphism (ii) Objects (iii) Classes (i) Polymorphism (ii) Objects (iii) Classes
(b) Explain how the memory address of a variable can be accessed in C++ (b) Explain how the memory address of a variable can be accessed in C++
(c) What are the input and output streams? (c) What are the input and output streams?
(B) Answer any TWO of the following: 4 (B) Answer any TWO of the following: 4
(a) What are constructor and destructor? Explain with example. (a) What are constructor and destructor? Explain with example.
(b) Explain Bubble sort algorithm with suitable example. (b) Explain Bubble sort algorithm with suitable example.
Q.4 (A) Answer any TWO of the following: 6 Q.4 (A) Answer any TWO of the following: 6
(a) What is record? How it differs from Linear Array? (a) What is record? How it differs from Linear Array?
(b) What are pointers in C++? Explain the use of pointer variable for function (b) What are pointers in C++? Explain the use of pointer variable for function
definition using call by value and by reference? definition using call by value and by reference?
(c) Describe how member functions of class can be defined outside the class (c) Describe how member functions of class can be defined outside the class
definition and inside the class definition. definition and inside the class definition.
(B) Answer any ONE of the following: 4 (B) Answer any ONE of the following: 4
(a) What is operator overloading? Explain with a suitable example. Why it (a) What is operator overloading? Explain with a suitable example. Why it
necessary to overload the operator necessary to overload the operator
(b) What is polymorphism? Explain runtime and compile polymorphism. (b) What is polymorphism? Explain runtime and compile polymorphism.
Q.5. Answer any TWO of the following: 10 Q.5. Answer any TWO of the following: 10
(a) Write a C++ program to accept a number and test whether it is prime or not. (a) Write a C++ program to accept a number and test whether it is prime or not.
(b) Write a program in C++ to display a Fibonacci series of 15 terms. (b) Write a program in C++ to display a Fibonacci series of 15 terms.
(c) Write a program in C++ to read a set of number from keyboard and find out (c) Write a program in C++ to read a set of number from keyboard and find out
the largest number in the given array. the largest number in the given array.
OR OR
(a) Write a program in C++ to find greatest common Divisor. (a) Write a program in C++ to find greatest common Divisor.
(b) Write a program in C++ that inputs and stores 10 numbers in an array and (b) Write a program in C++ that inputs and stores 10 numbers in an array and
print the sum and average of the array elements. print the sum and average of the array elements.
(c) Write a program in C++ to find sum of First 100 Natural Number. (c) Write a program in C++ to find sum of First 100 Natural Number.
=====================**** All the Best ****====================== =====================**** All the Best ****======================