Consider the problem of searching an element x in an array ‘arr[]’ of size n. The problem can be solved in O(Logn) time if.
1) Array is sorted
2) Array is sorted and rotated by k. k is given to you and k <= n
3) Array is sorted and rotated by k. k is NOT given to you and k <= n
4) Array is not sorted
(A) 1 Only
(B) 1 & 2 only
(C) 1, 2 and 3 only
(D) 1, 2, 3 and 4
Answer: (C)
Explanation: See https://www.geeksforgeeks.org/search-an-element-in-a-sorted-and-pivoted-array/
Quiz of this Question
Recommended Posts:
- Algorithms | Divide and Conquer | Question 3
- Algorithms | Divide and Conquer | Question 6
- Algorithms | Divide and Conquer | Question 2
- Algorithms | Divide and Conquer | Question 5
- Algorithms | Divide and Conquer | Question 4
- Algorithms Quiz | Greedy Algorithms | Question 8
- Algorithms | Analysis of Algorithms (Recurrences) | Question 8
- Algorithms | Analysis of Algorithms (Recurrences) | Question 6
- Algorithms | Analysis of Algorithms (Recurrences) | Question 7
- Algorithms | Analysis of Algorithms (Recurrences) | Question 1
- Algorithms | Analysis of Algorithms (Recurrences) | Question 11
- Algorithms | Analysis of Algorithms (Recurrences) | Question 3
- Algorithms | Analysis of Algorithms (Recurrences) | Question 11
- Algorithms | Analysis of Algorithms (Recurrences) | Question 2
- Algorithms | Analysis of Algorithms (Recurrences) | Question 11
- Algorithms | Analysis of Algorithms (Recurrences) | Question 9
- Algorithms | Analysis of Algorithms (Recurrences) | Question 4
- Algorithms | Analysis of Algorithms | Question 4
- Algorithms Quiz | Bit Algorithms | Question 4
- Algorithms | Analysis of Algorithms | Question 9

