MCQ Datastructure Python
MCQ Datastructure Python
8 Objective A linear collection of data elements where the linear node Linked list
is given by means of pointer is called
When new data are to be inserted into a data structure ,
9 Objective but there is no available space, this situation is usually Housefull
called
Arrays have
better cache
locality that
10 Objective Which of the following points is/are true about Linked List can make
data structure when it is compared with array
them better in
terms of
performance.
11 Objective Which of the following sorting algorithms can be used to Insertion Sort
sort a random linked list with minimum time complexity?
12 Objective Process of inserting an element in stack is called Create
In a stack, if a user tries to remove an element from an
13 Objective Underflow
empty stack it is called
ushing an element into stack already having five elements
14 Objective Overflow
and stack size of 5, then stack becomes
A collection of
Entries in a stack are “ordered”. What is the meaning of
15 Objective stacks is
this statement?
sortable
The postfix form of the expression (A+ B)*(C*D- E)*F / G AB+ CD*E –
18 Objective
is? FG /**
piling up of
Which of the following real world scenarios would you chairs one
25 Objective
associate with a stack data structure? above the
other
accessing item
from an
26 Objective What does ‘stack underflow’ refer to?
undefined
stack
What is the time complexity of pop() operation when the
27 Objective O(1)
stack is implemented using an array?
28 Objective What is the term for inserting into a full queue known as? overflow
Arrays are
dense lists and
38 Objective Which of the following statement is false ?
static data
structure
53 Objective Which case of data structure operation takes maximum Worst Case
time?
Every binary
Which of the following statements about a binary tree is
59 Objective tree has at
not correct?
least one node
60 Objective Which of the following is not a stable sorting algorithm? Insertion sort
Suppose we are sorting an array of eight integers using
The pivot
quicksort, and we have just finished the first partitioning
could be
61 Objective with the array looking like this:
either the 7 or
2 5 1 7 9 12 11 10
the 9.
Which statement is correct?
A structure
63 Objective What is a hash table? that maps
values to keys
A function has
allocated
64 Objective What is a hash function?
memory to
keys
Make the
65 Objective What can be the techniques to avoid collision? hash function
appear
random
66 Objective The complexity of Binary search algorithm is O(n)
67 Objective The operation of processing each element in the list is Sorting
known as
68 Objective Which of the following case does not exist in complexity Best case
theory
When Item is
69 Objective The Average case occur in linear search algorithm somewhere in
the middle of
the array
The item is
72 Objective In linear search algorithm the Worst case occurs when somewhere in
the middle of
the array
for relatively
73 Objective Linked lists are best suited permanent
collections of
data
Processor and
74 Objective Two main measures for the efficiency of an algorithm are
memory
75 Objective Finding the location of the element with a given value is: Traversal
It traverses in
79 Objective What is the speciality about the inorder traversal of a a non
binary search tree? increasing
order
80 Objective Which of the following is not a disadvantage to the usage Fixed size
of array?
Every binary
81 Objective Which of the following statement about binary tree is tree is either
CORRECT? complete or
full
Arrays have
better cache
locality that
Which of the following points is/are true about Linked List
92 Objective can make
data structure when it is compared with array?
them better in
terms of
performance.
Θ(logn) for
93 Objective What are the worst-case complexities of insertion and deletion
both
ofinsertion
a key in a binary search tre
and deletion
95 Objective Which of the following algorithm takes the same time in all Merge Sort
three cases (e.g., best, average, and worst)?
98 Objective Which among the following data structures is best suited HashMap
for storing very large numbers.
Suppose server and client are communicating with each
99 Objective other, and both are working at a different speed. Which of Graph
the following data structure is best suited for
synchronization?
Which of the following order is given by binary search tree Ascending
100 Objective
if we traverse it in inorder? order
For relatively
102 Objective Which of following is the advantage of using linked list? permanent
collections of
data
Which of following is contained by the header of the linked The address of
103 Objective
list? the first node
In linked list each node contains a minimum of two fields. Pointer to
104 Objective
One field is data field to store the data second field is? character
for relatively
permanent
107 Objective Linked lists are best suited …..
collections of
data.
108 Objective The operation of processing each element in the list is sorting
known as
109 Objective The situation when in a linked list START=NULL is Underflow
110 Objective Each node in singly linked list has …….. fields 2
111 Objective ………. refers to a linear collection of data items. List
112 Objective The dummy header in linked list contain first record of
the actual data
values in a
node are
greater than
every value in
113 Objective In a head tree the left
subtree and
smaller than
the right
subtree.
117 Objective ……… form of access is used to add and remove nodes LIFO, Last In
from a queue. First Out
118 Objective The retrieval of items in a stack is ……….. operation. push
119 Objective Which is the pointer associated with the stack? FIRST
120 Objective Deletion operation is done using ……… in a queue. front
121 Objective The elements are removal from a stack in ………. order. Reverse
It is placed on
122 Objective When an operand is read, which of the following is done?
to the output
127 Objective In infix to postfix conversion algorithm, the operators are right to left
associated from?
128 Objective What is the corresponding postfix expression for the given ab*cdef/^*g-
infix expression?a+(b*c(d/e^f)*g)*h) h+
Every binary
131 Objective Which of the following statement about binary tree is tree is either
CORRECT? complete or
full
132 Objective What is the worst case for linear search? O(nlogn)
133 Objective Which of the following is a disadvantage of linear search? Requires more
space
Which of the following is not the required condition for a The list must
134 Objective
binary search algorithm? be sorted
None of
Big oh Notation Omega Notation 1
these
Time Performance
None of these 1
complexity Analysis
The size of
array has to
It is easy to Random access is
be
insert and not allowed in a
delete typical pre-decided, All of the above 5
linked lists
elements in implementation of can
Linked List Linked Lists change their
size any time.
2 3 4 1
There are
chances of
wastage of
Accessing
memory space
Insertion based on elements at
if elements position specified 4
inserted in an
positions
array are lesser
than the
allocated size
people
offer services
standing in a tatkal Ticket
based on the
line to be Booking in 1
priority of the
serviced at a customer IRCTC
counter
removing items index out of
adding items to
from an empty bounds 3
a full stack
stack exception
program
null pointer
underflow won’t be 1
exception
compiled
Memory
Stack String 1
location
Coding Organization of
None of these 3
Standards data element
Composite Data
Primitive Data Type None of these 1
Type
It is collection
Implementation
of different None of these 3
Details are hidden
data types
A
A Priori Analysis A Feasibility Independent 2
Analysis
Analysis
A
A Priori Analysis A Feasibility Independent 1
Analysis
Analysis
Quadratic Linear Cubic 1
Every non- Every non-
empty tree has Every node has at root node has
1
exactly one most two children exactly one
root node parent
Selection sort Bubble sort Merge sort 2
The pivot could The pivot is not the Neither the 7
be the 7, but it 7, but it could be nor the 9 is 1
is not the 9 the 9 the pivot.
average-case case-
running time 2
complexity complexity
A structure
A structure that used to
A structure used
maps keys to implement 2
for storage
values stack and
queue
A function that
computes the A function that None of the
2
location of the creates an array mentioned
key in the array
Use the
chaining Use uniform All of the 4
hashing mentioned
method
When Item is
When Item is When Item is the the last
not in the array last element in the element in 1
the array or is
at all array
not there at
all
The item is
The item is not The item is the last the last
in the array at element in the element in 4
the array or is
all array
not there at
all
In order
The right child The left and right sequence
is always sub-trees should gives
4
greater than its also be binary decreasing
parent search trees order of
elements
It traverses
It traverses in
an increasing It traverses in a based on 2
random fashion priority of the
order
node
There are
chances of
wastage of
Accessing
memory space
if elements Insertion based on elements at 4
position specified
inserted in an
positions
array are lesser
than the
allocated size
A binary tree
Every complete Every full binary
cannot be
binary tree is tree is also a both 3
also a full complete binary
complete and
binary tree tree
full
Can have 1
Can have 0 children All of the the 4
children above
The size of
array has to
It is easy to Random access is
be pre-
insert and not allowed in a
decided,
delete typical All of the above 5
linked lists
elements in implementation of
can change
Linked Lis Linked Lists
their size any
time.
Θ(logn) for
Θ(n) for both Θ(n) for insertion
insertion and and Θ(logn) for insertion and 2
Θ(n) for
deletion deletion
deletion
5 10 8 3
Linked list is
more flexible it Less time None of the 2
can grow and complexity above
shrink easily
Pointer to the last Middle record
The address of
record of the actual of the actual 1
the last node
data data
Pointer to
Pointer to node Node 3
integer
values in a
node are
greater than conditions. terms. 2
every value in
children of it.
The contents
of the
It is placed in It is placed in the
operator 3
the output operator stack
stack is
emptied
ab+c* +ab abc+* 1
abc+*de*+ a+bc*de+* abc*+(de)*+ 1
It traverses in
an increasing It traverses in a None of the 2
random fashion mentioned
order
A binary tree
Every complete Every full binary
cannot be
binary tree is tree is also a both 3
also a full complete binary
complete and
binary tree tree
full
O(logn) O(n) O(1) 3
Greater time
complexities
Not easy to Not easy to
compared to 2
understand implement
other searching
algorithms