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 - Which one of the below is not divide and conquer approach?
Answer : B
Explanation
Among the options, only Merge sort divides the list in sub-list, sorts and then merges them together
Q 2 - A circular linked list can be used for
Answer : C
Explanation
Both stack and queue data structure can be represented by circular linked-list.
Q 3 - Minimum number of moves required to solve a Tower of Hanoi puzzle is
Answer : C
Explanation
Minimum number of moves required to solve a Tower of Hanoi puzzle is 2n - 1. Where n is the number of disks. If the number of disks is 3, then minimum number of moves required are 23 - 1 = 7
Q 4 - What could be the worst case height of an AVL tree?
Answer : C
Explanation
Worst case height of an AVL tree is 1.44 log n
Q 5 - Which of the following is example of in-place algorithm?
Answer : B
Explanation
Only Merge sort requires extra space.
Q 6 - Quick sort running time depends on the selection of
Answer : B
Explanation
If the pivot element is balanced, quick sort running time will be less.
Q 7 - In doubly linked lists
A - a pointer is maintained to store both next and previous nodes.
B - two pointers are maintained to store next and previous nodes.
Answer : B
Explanation
One pointer variable can not store more than one address values.
Q 8 - All possible spanning trees of graph G
A - have same number of edges and vertices.
B - have same number of edges and but not vertices.
Answer : A
Explanation
All possible spanning trees of graph G, have same number of edges and vertices.
Q 9 - From a complete graph, by removing maximum _______________ edges, we can construct a spanning tree.
Answer : A
Explanation
We can remove maximum e-n+1
edges to get a spanning tree from complete graph. Any more deletion of edges will lead the graph to be disconnected.
Q 10 - Apriori analysis of an algorithm assumes that −
A - the algorithm has been tested before in real environment.
B - all other factors like CPU speed are constant and have no effect on implementation.
Answer : B
Explanation
Efficiency of algorithm is measured by assuming that all other factors e.g. processor speed, are constant and have no effect on implementation.