Professional Documents
Culture Documents
Download As Pdf
Download As Pdf
Question 1
In the linked list
implementation of queue,
where will the new element
be inserted ?
At the middle
A position of the
linked list
At the head
B position of the
linked list
Explaination :
he answer is c. If the
queue is implemented
using linked list, then the
new element will be
inserted at the tail
position of the linked list
as Queue follows FIFO
principle in which new
element will always be
added at the end of the
Queue
Question 2
Which data structure is
mainly used for implementing
the recursive algorithm ?
A Queue
B Stack
C Binary Tree
D Linnked List
Correct
2
Ans :
Explaination :
The answer is b.
Recursion means calling
the function itself again.
Stack is used to
maintain the previous
records of the function .
Question 3
Which one of the following is
the overflow condition if
linear queue is implemented
using an array with a size
MAX_SIZE?
A rear = front
B rear = front +1
C rear=MAX_SIZE - 1
D rear = MAX_SIZE
Correct
3
Ans :
Explaination :
Correct
3
Ans :
Explaination :
Question 5
How can we describe an
array in the best possible
way?
Arrays are
B
immutable.
Container that
stores the
C
elements of
similar types
Correct
3
Ans :
Explaination :
The answer is c
because array stores the
elements in a
contiguous block of
memory of similar types .
Therefore, we can say
that array is a container
that stores the elements
of similar types .
Question 6
What is the maximum
number of children that a
node can have in a binary
tree?
A 3
B 1
C 4
D 2
Correct
4
Ans :
Explaination :
Question 7
If the size of the stack is 10
and we try to add the 11th
element in the stack then the
condition is known as___
A Underflow
Garbage
B
collection
C Overflow
Explaination :
The answer is c
because the stack is full
with its 10 elements , and
inserting one more
element in a stack will
lead to the stack
overflow.
Question 8
When a pop() operation is
called on an empty queue,
what is the condition called?
A overflow
B underflow
C syntax error
D garbage value
Correct
2
Ans :
Explaination :
Question 9
Which of the following
satisfies the property of the
Red Black tree?
A tree which is a
binary search tree
A
but not strictly
balanced tree.
A node must be
either Red or
B Black in color and
root node must be
black.
A tree with
C maximum three
children
D Both a and b
Correct
4
Ans :
Explaination :
Question 10
What would be the time
complexity if user tries to
insert the element at the end
of the linked list (head pointer
is known )?
A O(1)
B O(n)
C O(logn )
D O(nlogn )
Correct
2
Ans :
Explaination :