Top 350+ Solved Data Structures (DS) MCQ Questions Answer
Q. What is the advantage of recursive approach than an iterative approach?
a. Consumes less memory
b. Less code and easy to implement
c. Consumes more memory
d. More code has to be written
Q. Given an array arr = {45,77,89,90,94,99,100} and key = 99; what are the mid values(correspondingarray elements) in the first and second levels of recursion?
a. 90 and 99
b. 90 and 94
c. 89 and 99
d. 89 and 94
Q. What is the worst case complexity of binary search using recursion?
a. O(nlogn)
b. O(logn)
c. O(n)
d. O(n2)
Q. What is the average case time complexity of binary search using recursion?
a. O(nlogn)
b. O(logn)
c. O(n)
d. O(n2)
Q. Which of the following is not an application of binary search?
a. To find the lower/upper bound in an ordered sequence
b. Union of intervals
c. Debugging
d. To search in unordered list
Q. Binary Search can be categorized into which of the following?
a. Brute Force technique
b. Divide and conquer
c. Greedy algorithm
d. Dynamic programming
Q. Given an array arr = {45,77,89,90,94,99,100} and key = 100; What are the midvalues(corresponding array elements) generated in the first and second iterations?
a. 90 and 99
b. 90 and 100
c. 89 and 94
d. 94 and 99
Q. What is the time complexity of binary search with iteration?
a. O(nlogn)
b. O(logn)
c. O(n)
d. O(n2)
Q. What is an external sorting algorithm?
a. Algorithm that uses tape or disk during the sort
b. Algorithm that uses main memory during the sort
c. Algorithm that involves swapping
d. Algorithm that are considered ‘in place’
Q. What is an internal sorting algorithm?
a. Algorithm that uses tape or disk during the sort
b. Algorithm that uses main memory during the sort
c. Algorithm that involves swapping
d. Algorithm that are considered ‘in place’
Q. Which of the following is not an advantage of optimised bubble sort over other sorting techniquesin case of sorted elements?
a. It is faster
b. Consumes less memory
c. Detects whether the input is already sorted
d. Consumes less time