Practice MCQ for UT-II
1)
An algorithm that calls itself directly or indirectly is known as
a)
Stack b) Recursion
c)
Graph d) Traversal algorithm
2)
Overflow condition in linked list may occur when attempting to ________
a)
Create a node when free space pool is empty
b)
Traverse the node when free space pool is empty
c)
Create a node when linked list is empty
d)
None
3)
Infinite recursion leads to
a)
Overflow of run time stack b) Underflow of register usage
c)
Overflow of I/O cycle d) Underflow of run time stack
4)
Recursion is a method in which the solution of a problem depends on
____________
a)
Larger instances of different problems
b)
Larger instances of the same problem
c)
Smaller instances of the same problem
d)
Smaller instances of different problems
5)
In recursion, the condition for which the function will stop calling itself is
____________
a)
Best case
b)
Worst case
c)
Base case
d)
There is no such condition
6)
Which of the following statements is true?
a)
Recursion is always better than iteration
b)
Recursion uses more memory compared to iteration
c)
Recursion uses less memory compared to iteration
d)
Iteration is always better and simpler than recursion
7) One can determine whether a Binary Tree is a
Binary Search Tree by traversing it in
a)
Preorder b) Inorder
c)
Postorder d) Any of the three orders
8) If the inorder and preorder traversal of a
binary tree are D, B, F, E, G, H, A, C and A, B, D, E, F, G, H, C respectively
then the postorder traversal of that tree is
a)
D, F, G, A, B, C, H, E
b)
F, H, D, G, E, B, C, A
c)
C, G, H, F, E, D, B, A
d)
D, F, H, G, E, B, C, A
9)
The root node of a binary tree whose preorder traversal is FBADCEGIH is
a)
F b) H c) C d) E
10)If
a node having two children is deleted from a binary tree, it is replaced by its
a)
Inorder predecessor
b)
Inorder successor
c)
Preorder predecessor
d)
None of these
11)
If a node having two children is deleted from a binary tree, it is replaced by
its
a)
Inorder predecessor b) Inorder successor
c)
Preorder predecessor d) None of these
12)Which
of the following operations is performed more efficiently by doubly linked list
than by singly linked list ?
a)
Deleting a node whose location is given
b)
Searching of an unsorted list for a given item
c)
Inserting a new node after node whose location is given
d)
Traversing the list to process each node
13)If
in a linked list, address of first node is 1020 then what will be the address
of
node at 5th position ?
a)
1028 b) 1036
c)
1038 d) None of these
14)
When new element is added in the middle of singly linked list, then
a)
Only elements that appear after the new element and before need to be moved
b)
No need to move element
c)
Only elements that appear before the new element need to be moved
d)
Only elements that appear after the new element need to be moved
15)
Overflow condition in linked list may occur when attempting to ________
a)
Create a node when free space pool is empty
b)
Traverse the node when free space pool is empty
c)
Create a node when linked list is empty
d)
None
16)
Null pointer is used to tell
a)
End of Linked List
b)
Empty pointer field of structure
c)
The Linked List is empty
d)
All of above
17)
In circularly linked list organization, insertion of record involves the
modification of
a)
No pointer b) 1 pointer c) 2 pointers d) 3 pointers
18)
Overflow condition of queue is
a) rear = MAX – 1 b) front = MAX – 1 c)
top = MAX -1 d) both a & b
19) If Top is initialized to -1 and
we want to add 5 to the stack, the first step is
a) POP b)
PUSH 5 c) Increment top d) Decrement top
20)
Dynamic memory allocation means allocating the memory at
a) Run time b)
Execution time c) Both a & b d) None
21) Due to the nature of a recursive
definition, the implementation of a recursive method
involves __________
a) While loop b)
for loop c) if statement d) static variable