

MCQOPTIONS
Saved Bookmarks
This section includes 12 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures and Algorithms knowledge and support exam preparation. Choose a topic below to get started.
1. |
What is the time complexity of binary search with iteration? |
A. | O(nlogn) |
B. | O(logn) |
C. | O(n) |
D. | O(n2) |
Answer» C. O(n) | |
2. |
Given an array arr = {45,77,89,90,94,99,100} and key = 100; What are the mid values(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 |
Answer» B. 90 and 100 | |
3. |
Given an array arr = {5,6,77,88,99} and key = 88; How many iterations are done until the element is found? |
A. | 1 |
B. | 3 |
C. | 4 |
D. | 2 |
Answer» E. | |
4. |
Binary Search can be categorized into which of the following? |
A. | Brute Force technique |
B. | Divide and conquer |
C. | Greedy algorithm |
D. | Dynamic programming |
Answer» C. Greedy algorithm | |
5. |
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 |
Answer» E. | |
6. |
What is the average case time complexity of binary search using recursion? |
A. | O(nlogn) |
B. | O(logn) |
C. | O(n) |
D. | O(n2) |
Answer» C. O(n) | |
7. |
WHAT_IS_THE_AVERAGE_CASE_TIME_COMPLEXITY_OF_BINARY_SEARCH_USING_RECURSION??$ |
A. | O(nlogn) |
B. | O(logn) |
C. | O(n) |
D. | O(n<sup>2</sup>) |
Answer» C. O(n) | |
8. |
What_are_the_applications_of_binary_search?$ |
A. | To find the lower/upper bound in an ordered sequence |
B. | Union of intervals |
C. | Debugging |
D. | All of the mentioned |
Answer» E. | |
9. |
What is the worst case complexity of binary search using recursion? |
A. | O(nlogn) |
B. | O(logn) |
C. | O(n) |
D. | O(n<sup>2</sup>) |
Answer» C. O(n) | |
10. |
Given an array arr = {45,77,89,90,94,99,100} and key = 99; what are the mid values(corresponding array 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 |
Answer» E. | |
11. |
Given an input arr = {2,5,7,99,899}; key = 899; What is the level of recursion? |
A. | 5 |
B. | 2 |
C. | 3 |
D. | 4 |
Answer» C. 3 | |
12. |
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. | All of the mentioned |
Answer» C. Consumes more memory | |