Top 80+ Solved Searching, Sorting and Hashing Techniques MCQ Questions Answer
Q. Where is linear searching used?
a. When the list has only a few elements
b. When performing a single search in an unordered list
c. Used all the time
d. When the list has only a few elements and When performing a single search in an unordered list
Q. What is the best case and worst case complexity of ordered linear search?
a. O(nlogn), O(logn)
b. O(logn), O(nlogn)
c. O(n), O(1)
d. O(1), O(n)
Q. Which of the following is a disadvantage of linear search?
a. Requires more space
b. Greater time complexities compared to other searching algorithms
c. Not easy to understand
d. Not easy to implement
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)