What is the time complexity of binary search with iteration?
O(nlogn)
O(logn)
O(n)
O(n^{2})
30 practice sets · Page 2 of 2
What is the time complexity of binary search with iteration?
O(nlogn)
O(logn)
O(n)
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?
90 and 99
90 and 100
89 and 94
94 and 99
Given an array arr = {5,6,77,88,99} and key = 88; How many iterations are done until the element is found?
1
3
4
2
Binary Search can be categorized into which of the following?
Brute Force technique
Divide and conquer
Greedy algorithm
Dynamic programming
Which of the following is not an application of binary search?
To find the lower/upper bound in an ordered sequence
Union of intervals
Debugging
To search in unordered list
What is the average case time complexity of binary search using recursion?
O(nlogn)
O(logn)
O(n)
O(n^{2})
What is the worst case complexity of binary search using recursion?
O(nlogn)
O(logn)
O(n)
O(n^{2})
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?
90 and 99
90 and 94
89 and 99
89 and 94
Given an input arr = {2,5,7,99,899}; key = 899; What is the level of recursion?
5
2
3
4
What is the advantage of recursive approach than an iterative approach?
Consumes less memory
Less code and easy to implement
Consumes more memory
More code has to be written