• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
July 21, 2023 |1.5K Views
Search in a Rotated Array
Description
Discussion

In this video, we are a sorted and rotated array arr[] of size N and a key, the task is to find the key in the array. 

Note: Find the element in O(logN) time and assume that all the elements are distinct.

Example:  
Input  : arr[] = {5, 6, 7, 8, 9, 10, 1, 2, 3}, key = 3
Output : Found at index 8

Explanation: 8 is found at index 3.

Try it out before watching the implementation of the problem in the video. We recommend watching the video, even if you can solve the problem. You may discover something new. All the best!!!

Do check out:-

Article: https://www.geeksforgeeks.org/search-an-element-in-a-sorted-and-pivoted-array/
Problem: https://practice.geeksforgeeks.org/problems/search-in-a-rotated-array4618/1
SDE Sheet: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/

Read More