Documente Academic
Documente Profesional
Documente Cultură
Qus
A solution is said to be efficient if it solves the problem within its
1
resource constraints i.e. hardware and time
Which one of the following is known as "Last-In, First-Out" or LIFO
2
Data Structure?
What will be postfix expression of the following infix expression? Infix
3
Expression : a+b*c-d
For compiler a postfix expression is easier to evaluate than infix
4
expression?
declare a stack of characters, while ( there are more characters in the
word to read ){read a character; push the character on the stack;} while
5
( the stack is not empty ){pop a character off the stack; write the
character to the screen;} input "apples"?
Consider the following function: void test_a(int n) {cout << n << " "; if
6
(n>0) test_a(n-2); } What is printed by the call test_a(4)?
If there are N external nodes in a binary tree then what will be the no. of
7
internal nodes in this binary tree?
If there are N internal nodes in a binary tree then what will be the no. of
8
external nodes in this binary tree?
If we have 1000 sets each containing a single different person. Which of
9
the following relation will be true on each set:
10 Which one of the following is NOT the property of equivalence relation
11 A binary tree of N nodes has _______
The easiest case of deleting a node from BST is the case in which the
node to be deleted ___________
If there are N elements in an array then the number of maximum steps
13
needed to find an element using Binary Search is _______
Merge sort and quick sort both fall into the same category of sorting
14
algorithms. What is this category?
If one pointer of the node in a binary tree is NULL then it will be a/an
15
_______
12
Ans
True
False
Linked
List
Stack
Queue
Tree
ab+c*d-
abc*+d-
abc+*d-
abcd+*-
True
False
selpa
selppa
apples
aaappppplleess
42
024
02
24
N -1
N +1
N+2
N -1
N +1
N+2
Reflexive
Symmetric
Transitive
Associative
Reflexive
Log10 N
levels
Is a leaf
node
Symmetric
Transitive
Associative
N x 2 levels
Has left
subtree only
Has right
subtree only
N^2
Nlog2N
log2N
O(nlogn)
sorts
External
node
Interchange
sort
Root node
Inner node
ID
Qus
A
We convert the ________ pointers
16 of binary to threads in threaded
Left
binary tree
If the bottom level of a binary tree
17 is NOT completely filled, depicts Expression tree
that the tree is NOT a
What is the best definition of a
18
collision in a hash table?
Leaf node
Right
NULL
complete Binary
tree
Perfectly comp
Binary tree
22
23
24
25
26
27
28
29
30
ID
Qus
Which one of the following
31 is not an example of
equivalence relation?
Binary Search is an
32 algorithm of searching, used
with the ______ data
Which one of the following
33 is NOT true regarding the
skip list?
41
42
43
A find(x) on element x is
performed by returning
the root of the tree
containing x
A find(x) on
element x is
A find(x) on el
performed by
x is performed
returning the whole
returning TRU
tree itself
containing x
Initially each s
contains one el
and it does not
sense to make a
of one node on
Right to left
2640389175
2649170385 03826491
Pop
Top
Queue
None of these
Binary Search
55
56
57
22
23
24
First
Ans
Electrical connectivity
Set of people
<= relation
Set of pixels
Sorted
Unsorted
Heterogeneous
Random
35
By using __________we
avoid the recursive method
of traversing a Tree, which
36
makes use of stacks and
consumes a lot of memory
and time
Which of the following
statement is true about
37
dummy node of threaded
binary tree?
A binary tree of N
external nodes has N
internal node
A binary tree of N
A binary tree of N external A binary tree of N
internal nodes has N+ 1 nodes has N+ 1 internal
internal nodes has N- 1
external node
node
external node
Huffman encoding
N (h + 1)
N1
N1+h
ID
Qus
A
In case of deleting a
node from AVL tree,
48
Yes
rotation could be
prolong to the root node
when we have declared
the size of the array, it is
not possible to increase
49
Declaration
or decrease it during the
________of the
program
50 it will be efficient to
Variable
place stack elements at
the start of the list
No
Execution
Defining
Constant
Inconsistent
51
52
53
55
56
57
58
59
60
61
62
63
isFull(),isEmpty()
pop(), push()
isEmpty() , isFull()
push(),pop()
Singly-linked lists
Doubly-linked or si
linked lists are equa
N+1, N-1, 2N
Constant
Polynomial
Exponential
Linked list
Stack
Queue
Binary tree
11,22,33,44,55,66
11,22,33,44,66,55
11,22,33,66,44,55
11,22,66,33,44,55
Array ()
List
Both of these
None of these
2^H
2^H +1
2^H -1
2^H +2
ID
64
65
67
68
69
70
71
72
73
74
75
76
Qus
Which of the given option is NOT a factor in
Union by Size
Suppose A is an array containing numbers in
increasing order, but some numbers occur
more than once when using a binary search for
a value, the binary search always finds
____________
+ is a _________operator
A kind of expressions where the operator is
present between two operands called
________expressions
void f(int i, int &k) {i = 1;k = 2; } Suppose
that a main program has two integer variables
x and y, which are given the value 0. Then the
main program calls f(x,y); What are the values
of x and y ?
If you know the size of the data structure in
advance, i.e., at compile time, which one of the
following is a good data structure to use
If a complete binary tree has height h then its
no. of nodes will be,
If a max heap is implemented using a partially
filled array called data, and the array contains
n elements (n > 0), where is the entry with the
greatest value?
Which one is a self-referential data type?
There is/are ________ case/s for rotation in an
AVL tree,
Which of the following can be the inclusion
criteria for pixels in image segmentation
Consider te following array 23 15 5 12 40 10 7
After the first pass of a particular algorithm,
the array looks like 15 5 12 23 10 7 40 Name
the algorithm used
A
B
Maintain sizes
Make smaller
(number of nodes)
tree, the subtree
of all trees, and
of the larger one
during union
C
Make the larger
tree, the subtree
of the smaller
one
the second
the first occurrence
occurrence of a
of a value
value
Unary
Binary
Ternary
Postfix
Infix
Prefix
Array
List
Both of these
None of these
Log (h)
2^(h+1)- 1
Log (h) - 1
2^h - 1
data[0]
data[n-1]
data[n]
data[2*n+1]
Stack
Queue
Link list
All of these
Pixel intensity
Texture
Threshold of
intensity
Heap sort
Selection sort
Insertion sort
Bubble sort
Rotations equal
to number of
No rotation at all
levels
In a table, the type A table consists
A major use of table is in
The row of a
of information in of several
databases where we build
table is called a
columns may be
columns, known
use tables for keeping
record
different
as entities
information
77
79
80
ID
D
Implementation: for each
node i, instead of setting
parent[i] to -1, set it to -k
tree rooted at i has k node
One rotation
Two rotations
Leaf node
Qus
A
B
Suppose we are sorting an array of
eight integers using quick sort, and we
The pivot could be
have just finished the first partitioning The pivot could be either
81
the 7, but it is not
with the array looking like this: 2 5 1 the 7 or the 9
the 9
7 9 12 11 10 Which statement is
correct?
Root node
ID
96
Qus
__________ only removes
items in reverse order as they
were entered
32
33
66
Next
Start
Back
False
222
currentNode =
nextNode;
currentNode +=
nextNode;
currentNode =
currentNode->nextNo
LinkLists
Parse Tree
AVL Tree
add
update
preculateDown
8 to 15
8 to 16
8 to 17
3,4,6,7,5,1,10
3,4,1,5,7,10,6
1,4,3,7,5,10,6
Insertion Sort
Quick Sort
Merge Sort
N+1
N^2
A
Stack
Queue
Both of these
None of these
97
98
1.66 Log2n
Log2(n+1)
Log2(n+1) -1
103
104
105
106
107
108
109
110
111
112
7643521
7362145
7654321
A Threaded Binary Tr
a binary tree in which
every node that does n
have a right child has
THREAD (in actual
sense, a link) to its
POSTORDER success
6,7,5,4
4,5,6,7
4,6,5,7
Exponential
Polynomial
level-order
inorder
Stack
Queue
Tree
Lists
Both of these
None of these
last % (1 + CAPACITY)
(last + 1) % CAPACITY
last + (1 %
CAPACITY)
113
115
116
117
increaseKey(p,delta)
decreaseKey(p,delta)
preculateDown(p,delta)
remove(p,delta
Reflexive
Symmetric
Transitive
Associative
None of above
statement is a
property of the
binary tree
n log n
n2
In a selection sort of n
elements, how many times
119 the swap function is called n-1
to complete the execution
of the algorithm?
Consider the following
postfix expression S and
the initial values of the
variables. S = A B - C + D
120 E F - + ^ Assume that
-1
A=3, B=2, C=1, D=1,
E=2, F=3 What would be
the final output of the
stack?
To perform Union of two
Which of the following
sets, we merge the two
122 statement is correct about trees by making the root of
union?
one tree point to the root of
the other
Let heap stored in an array
as H = [50, 40, 37, 32, 28,
22, 36, 13]. In other words,
the root of the heap
123
[50,32, 37,13, 28, 22, 36]
contains the maximum
element. What is the result
of deleting 40 from this
heap
In an array we can store
124 data elements of different True
types
Which one of the
In linked list the elements
125 following statement is
are necessarily to be
NOT correct
contiguous
Doubly Linked List always
126
True
has one NULL pointer
128
Iteration is mo
efficient than
iteration
Recursion is m
Iterative function calls
efficient than
consumes a lot of memory
iteration
Recursive function calls
consume a lot of memory
False
In linked list the elements
may locate at far positions
in the memory
False
inserted and removed from
the top
inserted and
removed from
both ends
ID
Qus
129 Each node in doubly link list has
I have implemented the queue with a linked list, keeping
track of a front pointer and a rear pointer. Which of these
130
pointers will change during an insertion into an EMPTY
queue?
If a complete binary tree has n number of nodes then its
131
height will be
If a complete binary tree has height h then its no. of nodes
132
will be
A binary relation R over S is called an equivalence
133
relation if it has following property(s)
Use of binary tree in compression of data is known as
134
_______
135
ID
Qus
A
1 pointer
B
2 pointers
C
3 pointers
D
4 pointers
Ans
B
Neither
changes
Only front
pointer
changes
Both change
Log2 (n+1) -1
2n
Log2 (n) - 1
2n - 1
Log (h)
2^(h+1) - 1
Log (h) - 1
2^h - 1
Reflexivity
Symmetry
Transitivity
Traversal
Heap
Union
Huffman encoding
Equal to the
Equal to the
small frequency greater
Equal to the
Equal to the sum of
difference of the
the two frequencies
two frequencies
Inorder
levelorder
Preorder
Postorder
partially
completely
incompletely
partly
x y -a * b +c /
x *y a - b c / + x y a * - b c / +
x y a * - b/ + c
left, right
Right, left
Down, up
True
False
a synonym
an antonym
a value
a number
Source
Template
Destination
State
&
Up, down
D
none of the given
options
Ans
data type
memory reference
value
member
functions
classes
objects of a class
constructors
Analysis
Design
Coding
name[5] float;
float name[5];
left most
Root
right most
146
156
ID
2i-1
2i
Yes
No
True
False
a = X (b) ;
a = X (&b) ;
True
False
Linear data
structure
Non-linear data
structure
Whenever the
parameter has
huge size
Whenever the
parameter has huge
size, the function
changes the parameter
within its body, and you
DO want these changes
to alter the actual
argument
Whenever the
parameter has huge
size, and the function
B
does not change the
parameter within its
body
n (where n is the
argument)
There is no fixed
maximum
Log2 (n+1) -1
Log2 (n+1)
Log2 (n) - 1
Log2 (n)
Qus
2i+1
floor(i/2)
a = X (*b) ;
C
After all other
entries that are
greater than the
new entry
D
After all other
entries that are
smaller than the
new entry
Ans
At the tail
data[1]
data[2]
data[11]
data[12]
Prefix
expression
Postfix
expression
Infix expression
None of these
Binary Search
tree
AVL tree
All of these
H and E
D and E
L and M
Call by passing
the value of the
argument
At least half of
Any one node
the nodes fulfill
fulfills the AVL
the AVL
condition
condition
Call by passing
reference of the
argument
Call by passing
the address of the B
argument
Leaf Nodes
Root Nodes
Both of these
None of these
True
False
True
False
170
171
172
173
174
ID
175
176
177
178
179
Qus
In which of the traversal
method, the recursive calls can
be used to traverse a binary
tree ?
Suppose currentNode refers to a
node in a linked list (using the
Node class with member
variables called data and
nextNode). What boolean
expression will be true when
cursor refers to the tail node of
the list?
Which of the following tests in
the client code correctly
compares two class objects
alpha and beta?
In C what is the operation that
you can not do with primitive
types?
The operation for adding an
entry to a stack is traditionally
called
1
None of the
given options
A
In preorder
traversal only
Ans
In postorder traversal
All of the given options
only
(currentNode == (currentNode->nextNode
null)
== null)
(nextNode.data ==
null)
(currentNode.data == 0.0)
if (LessThan(alpha,
beta))
if (LessThan(alpha).beta)
if (alpha.LessThan(beta))
add
append
insert
push
ID
190
191
192
193
194
195
196
delete
peek
pop
remove
7 8 9 10 11 12
9 8 11 10 7 12
9 10 8 11 12 7
9 10 8 12 7 11
Zero
Any Number
None of these
Stack
Queue
Both of these
None of these
True
False
if (alpha.LessThan(beta))
if (LessThan(alpha,
beta))
if (LessThan(alpha).beta)
FIFO, LIFO
LIFO,FIFO
none of these
both of these
Multiplication
operator
Minus operator
Plus operator
Exponentiation operator
Trees are
recursively
defined multidimensional data
structures tree
A search tree is a
special type of tree
where all values (i.e.
keys) are ordered
C
We can increase but
can't decrease the size
of arrays after their
creation
Qus
Which of the following is "TRUE"
about arrays
Consider the following infix
expression. 5 + 6/2 If one converts the
above expression into postfix, what
would be the resultant expression?
Addition of new items in stack make
the pointer ------------ by 2
Next item in a linked list is known as
In an AVL tree to delete a parent with
two childs in a straight line following
rotations will be required
BST is a Structure
After creation of an array
Ans
56/ + 2
562/+
56/2+
/62 + 5
Increment, bits
Increment, bytes
Decrement, bits
Decrement, bytes
Index
Item
Node
Child
Single
Double
Triple
None
Circular
Size can neither be
increased nor be
None of Above
B
Size can be increased and C
can also be decreased
Linear
Non Linear
Size can be
Size can be
increase but can not decreased but can
ID
205
be decreased
1
not be increased
2
decreased
3
Plus
Minus
Multiply
Exponentiation
Stacks
Queues
Both a & b
Node
First Node
Last Node
Head Node
True
False
Linear
Non Linear
Circular
None of Above
Prefix
Postfix
Infix
None of these
Qus
Which statement of the following statements is
incorrect?
A
Lists can be
implemented by
using arrays or
linked lists
Stack
C
Stack is a special kind
A list is a sequence
of list in which all
of one or more data
insertions and deletions
items
take place at one end
Queue
Binary Search Tree
D
Ans
Stacks are
easier to
D
implement than
lists
AVL Tree
A
420
024
02
24
None of these
AVL tree
All of these
50
60
70
80
Array
List
Both of these
None of these
int &x ;
int *x ;
int x ;
None of the
given options
True
False
Arrays
LinkLists
B
Binary Search Trees
None of these
216
ID
220
221
222
223
225
226
227
228
Qus
An array is a group of
consecutive related
memory locations
A node cannot be deleted,
when the node to be
deleted has both left and
right subtrees
Deleting a leaf node in
binary search tree
involves setting ______
pointer/s of that nodes
parent as null
For a perfect binary tree
of height 4. What will be
the sum of heights of
nodes?
If we want to find median
of 50 elements, then after
applying buildHeap
method, how many times
deleteMin method will be
called ?
The main reason of using
heap in priority queue is
The total number of nodes
on 10th level of a perfect
binary tree are
Which property of
equivalence relation is
None of these
float
long
None of these
356+*785+-*
356*+785
+*-
True
False
True
False
31
30
27
26
25
35
50
improve performance
code is readable
less code
heap can't be u
queues
256
512
1024
Can't be determ
Reflexivity
Symmetry
Transitivity
229
230
231
232
233
234
235
55
51
50
49 N-1= 49
AVL tree
Binary tree
None of these
44
45
46
90
Max heap
Complete Bina
N-1
N+1
N+2
Dummy
rootNode
LTH
RTH
ID
Qus
A
236 An expression tree will always be a Complete binary tree
In a threaded binary tree which
237
All leaf nodes
nodes have NULL child pointers
We implement the heap by
238
Threaded Tree
____________
239
B
Binary search tree
Nodes other then leaf
nodes
C
Heap AVL tree
AVL tree
Root Node
D
Non of then
None of the
nodes
Ans
B
Expression
It has N+2
A
internal nodes
False