Escolar Documentos
Profissional Documentos
Cultura Documentos
INSTITUTE OF TECHNOLOGY
Coimbatore-641048
Prepared by Reviewed by
Mrs.K.Mouthami,AP/IT Academic Coordinator
Approved by
HoD/IT Principal
CS6301 PROGRAMMING AND DATA STRUCTURES II
4. Object based language differs from object oriented language as it does not support features
1.Encapsulation
2. Inheritance
3. Dynamic Binding
4. Abstraction
5. Polymorphism
a. only 3 ,4
b. only 1,3,5
c. 2,4,5
d. Only 2,3
6. ____________ refers to the act of representing only essential features without including the
background details.
a. Data Hiding
b. Data Encapsulation
c. Data Abstraction
d. All of these
7. Which of the followings are false statements about Local class?
1. A local class type name can only be used in the enclosing function
2. All the methods of Local classes must be defined inside the class only
3. A Local class can contain static data members.
4. A Local class may contain static functions.
5. Non-static variables of the enclosing function are not accessible inside local classes.
6. Local classes cannot access global types, variables and functions.
a. Only 1,3
b. Only 3, 6
c. Only 2 , 4 , 6
d. None of these
8. Only functions of the class can access the data of the class and they(functions) provides the
interface between data, objects and the program. This kind isolation of the data from direct
access by the program is called _______________ .
a. Data Abstraction
b. Data Hiding
c. Data Binding
d. Data Encapsulation
int x = 786;
cout << setfill(‘*’) << setw(6) << x;
- Published on 17 Jul 15
a. 786***
b. **786
c. ***786
d. ******
5. _______________ is a member function that is declared within a base class and redefined by
derived class.
a. virtual function
b. static function
c. friend function
d. const member function
6. While overloading binary operators using member function, it requires ___ argument/s.
a. Zero
b. One
c. Two
d. Three
10. Using friend operator function, following perfect set of operators may not be overloaded.
a. = , ( ) , [ ] , ->
b. <<, = = , [ ] , >>
c. ?, = , ( ) , ++
d. None of these
4. Which of the following manipulator is used for the representing octal equivalent of a given
decimal number?
a. oct
b. setbase(8)
c. tobase(8)
d. both a and b
e. all a, b, c
5. In case of binary operator overloading with member function, which of following statement
should be taken into consideration?
a. Right hand operand must be object.
b. Left hand operand must be object.
c. Both the operands must be objects.
d. All of these should be considered.
10. Streams that will be performing both input and output operations must be declared as class
_________ .
a. iostream
b. fstream
c. stdstream
d. Stdiostream
1. Consider a two dimensional array of integers arr[1…. 10][1…. 15]. One memory location is
occupied by each integer. The first element of array is stored at location 100 and the array is
stored in row-major order. The address of the element arr[i][j] is
(A) 15j + i + 84
(B) 15i + j + 84
(C) 21i + j + 93
(D) 21j + I + 93
2. Assuming that the height of a tree with a single node is 0, the maximum height of any AVL-
tree with 7 nodes is
(A) 5
(B) 4
(C) 3
(D) 2
3. The order of precedence from highest to lowest is ∧, x, +, - assuming that the operators +, -, x
are left associative and ∧ is right associative. The infix expression is a + b x c – d ∧ e ∧ f. The
postfix expression corresponding to infix expression is
4. Consider four modules whose lengths are 200, 800, 600 and 500. These modules are read by a
linker and are loaded in that order. The relocation constants are
(A) Pointers
(B) Records
(C) Arrays
(D) Recursive procedures with local variables
6. A postfix expression with single digit operands that is evaluated using stack is
8 2 3 ∧ / 2 3 * + 5 1 * - (where ∧ is the exponentiation operator).
6. What are the top two elements of the stack after the first * is evaluated?
(A) 1, 8
(B) 5, 7
(C) 2, 3
(D) 6, 1
7. Match the following:
(A) P – 2, Q – 1, R - 3
(B) P – 3, Q – 2, R - 1
(C) P – 3, Q – 1, R - 2
(D) P – 1, Q – 3, R – 2
(A) string
(B) gnirt
(C) gnirts
(D) Output is not printed
9. What is the advantage of chained hash table (external hashing) over open addressing scheme?
10. Consider an unlabelled binary tree with n number of nodes and a set of n distinct elements.
With the given set, in how many ways the tree can be populated so that it becomes a binary
search tree?
(A) (1 / n +1) 2n Cn
(B) n!
(C) 0
(D) 1
UNIT V GRAPHS
1.Which data structure is used in breadth first search of a graph to hold nodes?
A) Stack
B) queue
C) Tree
D) Array
D. Literally connected