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 - What is the worst case run-time complexity of binary search algorithm?
In the worst case, binary search will be left or right intended, making it compare all the n values.
Q 2 - Maximum number of nodes in a binary tree with height k, where root is height 0, is
If the root node is at height 0, then a binary tree can have at max 2k+1 − 1 nodes.
For example: a binary tree of height 1, can have maximum 21+1 − 1 = 3 nodes.
r --------- 0 / \ L R --------- 1
A linked-list is dynamic structure, it can shrink and expand as required by the program.
Q 4 - Maximum degree of any vertex in a simple graph of vertices n is
In a simple graph, a vertex can have edge to maximum n - 1 vertices.
Q 5 - Graph traversal is different from a tree traversal, because
As trees do not have loops, they are easier to traverse.
Q 6 - Time required to merge two sorted lists of size m and n, is
The time required to merge two sorted list is Ο(m + n).
Q 7 - Which of these alogrithmic approach tries to achieve localized optimum solution −
Greedy approach focuses only on localized optimum solution.
Q 8 - If there's no base criteria in a recursive program, the program will
Without a base criteria and progressive approach, a recursion is just an infinite iteration.
Q 9 - Binary search tree is an example of complete binary tree with special attributes.
BST does not care about complete binary tree properties.
Q 10 - A stable sorting alrithm −
A stable sorting algorithm like bubble sort, does not change the sequence of appearance of similar element in the sorted list.