Module: C++ & Data Structures Using C++ Session No. 1 Q. No. 1
Module: C++ & Data Structures Using C++ Session No. 1 Q. No. 1
Session No. 1
Q. No. 1
A. data
B. functions
C. both a & b
D. none of the mentioned
Q. No. 2
Which other keywords are also used to declare the class other than class?
A. struct
B. union
C. object
D. both a & b
Session No. 2
Q. No. 3
A. protected
B. private
C. public
D. None of the mentioned
Q. No. 4
. When struct is used instead of the keyword class means, what will happen in the program?
Session No. 3
Q. No. 5
A. function overloading
B. operator overloading
C. member overloading
D. None of the mentioned
Q. No. 6
Session No. 4
Q. No. 7
Q. No. 8
Which constructor will initialize the base class data member?
A. derived class
B. base class
C. class
D. None of the mentioned
Session No. 5
Q. No. 9
Q. No. 10
What does derived class does not inherit from the base class?
A. constructor and destructor
B. friends
C. operator = () members
D. all of the mentioned
Session No. 6
Q. No. 11
Q. No. 12
A. allocation of memory
B. de-allocation of memory
C. both a & b
D. none of the mentioned
Session No. 7
Q. No. 13
A. #include<iostream>
B. #include<fstream>
C. #include<file>
D. None of the mentioned
Q. No. 14
Which member function is used to determine whether the stream object is currently
associated with a file?
A. is_open
B. buf
C. string
D. None of the mentioned
Q. No. 15
A. base class
B. abstract class
C. method
D. None of the mentioned
Q. No. 16
Q. No. 17
In a heap, element with the greatest key is always in the ___________ node
A. leaf
B. root
C. first node of left sub tree
D. first node of right sub tree
Q. No. 18
Session No. 10
Q. No. 19
A data structure where elements can be added or removed at either end but not in the middle
A. Linked lists
B. Stacks
C. Queues
D. Deque
Q. No. 20
A. underflow
B. overflow.
C. housefull.
D. saturated
Session No. 11
Q. No. 21
A. An array is suitable for homogeneous data but hte data items in a record may have different
data type.
B. In a record, there may not be a natural ordering in opposed to linear array .
C. A record form a hierarchical structure but a lienear array does not
D. All of above
Difficulty Level: Intermediate
Q. No. 22
When inorder traversing a tree resulted E A C K F H D B G; the preorder traversal would return
A. FAEKCDBHG
B. FAEKCDHGB
C. EAFKHDCBG
D. FEAKDCHBG
Session No. 12
Q. No. 23
A. Trees
B. Graphs
C. Arrays
D. None of above
Q. No. 24
Session No. 13
Q. No. 25
The height of a BST is given as h. Consider the height of the tree as the no. of edges in the longest
path from root to the leaf. The maximum no. of nodes possible in the tree is?
E. 2h-1 -1
F. 2h+1 -1
G. 2h +1
H. 2h-1 +1
Q. No. 26
The no of external nodes in a full binary tree with n internal nodes is?
A. n .
B. n+1.
C. 2n.
D. 2n + 1
Session No. 14
Q. No. 27
Consider an undirected graph G with 100 nodes. The maximum number of edges to be included in G
so that the graph is not connected is
A. 2451
B. 4950
C. 4851
D. 9900
Q. No. 28
The amortized time complexity to perform ______ operation(s) in Splay trees is O(Ig n).
A. Search
B. Search & Insert
C. Search & Delete
D. Search,Insert & Delete
Session No. 15
Q. No. 29
E. 2d − 1
F. 2d + 1 − 1
G. d+1
H. d
Q. No. 30
A. Queue
B. Linked list
C. Doubly linked list
D. Binary tree
Session No. 16
Q. No. 31
A. Insertion sort
B. Selection sort
C. Bubble sort
D. Merge sort
Q. No. 32
A. Selection sort
B. Heap sort
C. Quick sort
D. Merge sort
Session No. 17
Q. No. 33
A. O(n)
B. O(nlogn)
C. O(n2)
D. None
Q. No. 34
The time complexity of a quick sort algorithm which makes use of median, found by an O(n)
algorithm, as pivot element is
A. O(n2)
B. O(nlogn)
C. O(nloglogn)
D. Merge sort
Session No. 18
Q. No. 35
A. Counting sort
B. Bucket sort
C. Radix sort
D. Shell sort
A. O(logn)
B. O(n)
C. O(nlogn)
D. O(n2)
Session No. 19
Q. No. 37
Q. No. 38
A. Counting microseconds
B. Counting the number of key operations
C. Counting the number of statements
D. Counting the kilobytes of algorithm
Session No. 20
Q. No. 39
Q. No. 40
E. Best case
F. Worst case
G. Average case
H. Null case
Session No. 21
Q. No. 41
Q. No. 42
The indirect change of the values of a variable in one module by another module is called
A. internal change
B. inter-module change
C. side effect
D. side-module update
Session No. 22
Q. No. 43
Algorithms may be stated in an operation specification for which of the following reasons?
Q. No. 44
A. Contiguous Implementation
B. Linked Implementation
C. All of the mentioned
D. None of the mentioned
Total No of Question : 44