You are on page 1of 6

Which of the following is an application of binary serach?

A. Finding square root of a number


B. FInding GCD of a given numbers
C. Finding K-th element in an array
D. Finding root of a number
ANSWER: A

For following input strings{Fire, Figure, Fight, firm, Fictures, Fit}, what is the
longeat common prefix?
A. Fi
B. F
C. Null
D. Fir
ANSWER: C

Which of the following technique will suite for finding square root a number?
A. Binary Search
B. Linear search
C. Sequential Search
D. Indexed Sequential Search
ANSWER: A

Which of the following technique will suite for finding the longeat common prefix?
Options: (i) Linear search (ii) Binary and linear search (iii) Binary Search (iv)
Sorting techniques.
A. (i) only
B. (iii) only
C. (ii) and (iv)
D. (iii) and (iv)
ANSWER: B

Which of the following sorting will finds maximum or minimum element from the given
set in the sorting iteration?
A. Bubble sort
B. Insertion Sort
C. Selection Sort
D. Quick sort
ANSWER: C

Consider the indian cricket team player list given as input, while sorting those
names, if two successive names were used for comparison, then which sorting will
suit for this?
A. Bubble sort
B. Insertion Sort
C. Selection Sort
D. Quick sort
ANSWER: A

If sorted element given as an input for the insertion sort , then what is the time
complexity?
A. O(1)
B. O(n)
C. Omega(n)
D. Omega(1)
ANSWER: C

Which of the following uses the divide and conqure concepts in sorting? Options: (i)
Quick Sort (ii) Merge Sort (iii) Selection Sort (iv) Insertion Sort
A. (i) only
B. (ii) only
C. (i) and (ii)
D. (ii) and (iii)
ANSWER: C

For the follwing input set {india, covid, corona, positive, negative, mask, washing,
distance}, in that if we are selecting "negative" word and move that word to one
corner of the input set, based on this word, if we perfom sorting, then which
sorting will suit for this?
A. Bubble sort
B. Insertion Sort
C. Selection Sort
D. Quick sort
ANSWER: D

If There is a bigger problem is given then finding the solution is very difficult,
so divide the given problem into small pieces for finding the solution; after that
all soltions were combined, then which sorting will suit for this? Options: (i)
Quick Sort (ii) Merge Sort (iii) Selection Sort (iv) Insertion Sort
A. (i) only
B. (ii) only
C. (i) and (ii)
D. (ii) and (iii)
ANSWER: B

If two sorted array is given as input for sorting , then which sorting will suit for
this? Options: (i) Quick Sort (ii) Merge Sort (iii) Bubble Sort (iv) Insertion Sort
A. (i) only
B. (ii) only
C. (ii) and (iiI)
D. (i) and (ii)
ANSWER: B

In a tree, if the degree of node is 0 then it is referred as?


A. Child node
B. Leaf node
C. Sibling node
D. Parent node
ANSWER: B

In a tree, if there is no sibling node for a x-node then how many childrens of x's
parent?
A. 1
B. many child possible
C. 0
D. 2
ANSWER: A

In a tree, a node does not have parent node, then it is referred as?
A. Child node
B. Leaf node
C. Sibling node
D. Root node
ANSWER: D

Consider a tree, in level 0 there will only one node and in level 1, there will be
three nodes namely A, B, C. Then how many siblings of B node?
A. 1
B. can not calculate
C. 0
D. 2
ANSWER: D

Consider d is the last level in a tree, in that d level there will be the nodes like
M, N, O, P. What is the degree of a node N?
A. 1
B. can not calculate
C. 0
D. 3
ANSWER: C

In a binary tree, how many sibling may have by a node except root node?
A. 1
B. can not calculate
C. 0
D. 2
ANSWER: A

In a binary tree, a node position is an even number in an array representation, then


that node will be____________
A. left child
B. right child
C. Root node
D. None
ANSWER: B

In a Binary tree, a node-X contains A as left child and B as right child. If we want
to insert Y will be the left child , then which o the following condition to
used?(Note: makenode is a function to create a dummy node)
A. X->left=makenode(Y)
B. X->left=Y
C. X->left=A->left=Y
D. can not insert
ANSWER: D
In a binary tree, a node set to be a parent node then it should contain two child in
it, which is called as?
A. Perfect Binary Tree
B. Full Binary Tree
C. Complete Binary Tree
D. Degenerate Binary Tree
ANSWER: B

In a binary tree, a node set to be a parent node then it should contain only one
child in it, which is called as?
A. Perfect Binary Tree
B. Full Binary Tree
C. Complete Binary Tree
D. Degenerate Binary Tree
ANSWER: D

After traversing an expression tree, if we get an output is 8+(2*3/7)-6, then which


traversal technique we used for that?
A. Inorder
B. Preorder
C. Postorder
D. Ascending order
ANSWER: A

Consider a tree which contains A will be the root node and B, C, D are children of A
. Then what is the Postorder for the tree (After coversion)?
A. ABCD
B. DCBA
C. ACBD
D. DBCA
ANSWER: B

Consider a tree which contains A will be the root node and B, C, D are children of
A. If we want to find inorder, preorder and postorder then which of the following
intermediate step is required?
A. No intermediate step required, directly we can find the inorder, preorder and
postorder
B. Tree to Binary Tree conversion
C. Left Root Right, Root Left Right, Left Right Root
D. None
ANSWER: B

Consider a tree which contains A will be the root node and B, C, D are children of
A. After binary tree conversion of tree, which will be the right child of A?
A. C
B. D
C. Null
D. B
ANSWER: C
For the follwing input set {india, covid, corona, positive, negative, mask, washing,
distance}, after BST construction, What is the degree of "distance" node?
A. 1
B. 2
C. 0
D. 3
ANSWER: C

Which of the following is an application of BST?


A. Finding square root of a number
B. FInding GCD of a given numbers
C. Finding K-th element in an array
D. Dictionary
ANSWER: D

In a linked representation of BST, when we cant perform insertion? options: (i) if


malloc() returns null (ii) if inserting node is a leaf node (iii) if inserting node
is left child and parent have left child already (iv) if inserting node is right
child and parent have right child already.
A. (iv) only
B. (iii) only
C. (iii) and (iv)
D. (i) and (ii)
ANSWER: C

In directed graph, there exist edge from u to v, then (i) u is the adjacency node to
v (ii) v is the adjacency node to u (iii) u is a dead node (iv) v is not an
adjacency to u
A. (i) only
B. (ii) only
C. (ii) and (iv)
D. (i) and (ii)
ANSWER: B

There exist edge from u to u, then it is refered as______________


A. Simple graph
B. Self loop
C. Cycle
D. Parallel edges
ANSWER: B

A graph does not have self loop and parallel edges then it said to be_____________
A. Simple graph
B. Acyclic graph
C. Cyclic grapg
D. Parallel graph
ANSWER: A

Stack can be used in___________


A. DFS
B. BFS
C. Kruskal's
D. Prim's
ANSWER: A

You might also like