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 a min-heap:
In a min heap, parents always have lesser or equal values than that of their childs.
Stack uses push() to insert an item in stack, and pop() to remove the top item from stack.
Q 3 - Minimum number of moves required to solve a Tower of Hanoi puzzle is
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 - Binary search tree has best case run-time complexity of Ο(log n). What could the worst case?
In case where binary search tree is left or right intended, the worst case can be Ο(n)
Q 5 - After each iteration in bubble sort
In one iteration of Bubble sort, the maximum of the set in hand is moved at the end of the unsorted list. Hence one less comparison.
Q 6 - In context with time-complexity, find the odd out −
Binary heap heapify operation has time-complexity of Ο(n), while other operations have time-complexity of Ο(1) only.
Q 7 - Index of arrays in C programming langauge starts from
Arrays, in C, starts from 0 which is mapped to its base address.
Q 8 - All possible spanning trees of graph G
All possible spanning trees of graph G, have same number of edges and vertices.
Q 9 - Access time of a binary search tree may go worse in terms of time complexity upto
At maximum, BST may need to search all n values in the tree in order to access an element, hence, Ο(n).
Q 10 - If the data collection is in sorted form and equally distributed then the run time complexity of interpolation search is −
Runtime complexity of interpolation search algorithm is Ο(log (log n)) as compared to Ο(log n) of BST in favourable situations.