Friday, January 10, 2025
Google search engine
HomeData Modelling & AIAlgorithms | Divide and Conquer | Question 6

Algorithms | Divide and Conquer | Question 6

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

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!

RELATED ARTICLES

Most Popular

Recent Comments