Data Structures Algorithms Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to Data Structures Algorithms. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Q 1 - In order traversal of binary search tree will produce −
Answer : C
Explanation
Binary search tree yields a sorted list when traversed in-order.
Answer : C
Explanation
Stack uses push() to insert an item in stack, and pop() to remove the top item from stack.
Q 3 - Which of the following asymptotic notation is the worst among all?
Answer : B
Explanation
Ο(n+9378) is n dependent
Ο(n3) is cubic
nΟ(1) is polynomial
2Ο(n) is exponential
Q 4 - What is not true about insertion sort?
A - Exhibits the worst case performance when the initial array is sorted in reverse order.
B - Worst case and average case performance is Ο(n2)
C - Can be compared to the way a card player arranges his card from a card deck.
Answer : D
Explanation
All given options are true about insertion sort.
Q 5 - An algorithm is
A - a piece of code to be executed.
B - a loosely written code to make final code.
Answer : C
Explanation
An algorithm is a step by step procedure to solve a computer problem.
Q 6 - In binary heap, whenever the root is removed then the rightmost element of last level is replaced by the root. Why?
A - It is the easiest possible way.
B - To make sure that it is still complete binary tree.
Answer : B
Explanation
A binary heap (whether max or min) has to satisfy the property of complete binary tree at all times.
Q 7 - Which of the following is not possible with an array in C programming langauge −
Answer : C
Explanation
Array in C are static and cannot be shrinked or expanded in run-time.
Q 8 - Recursion uses more memory space than iteration because
A - it uses stack instead of queue.
Answer : B
Explanation
Recursion uses stack but the main reason is, every recursive call needs to be stored separately in the memory.
Q 9 - If we choose Prim's Algorithm for uniquely weighted spanning tree instead of Kruskal's Algorithm, then
A - we'll get a different spanning tree.
B - we'll get the same spanning tree.
Answer : B
Explanation
Regardless of which algorithm is used, in a graph with unique weight, resulting spanning tree will be same.
Q 10 - Which of the following algorithm does not divide the list −
Answer : A
Explanation
Linear search, seaches the desired element in the target list in a sequential manner, without breaking it in any way.