Problem explanation: Initial Sorted array: [0,1,2,4,5,6,7] After rotation it becomes [4,5,6,7,0,1,2]. Target = 0 Index = 4 [as array index starts from 0] This problem can be solved by 2 ways: 1. Linear Search 2. Modified Binary search 1. Linear search: In this solution we search the element one by one, and return the index. … Continue reading Given an array sorted in ascending order and is rotated at some pivot, given a target value to search, if found in the array return its index
Copy and paste this URL into your WordPress site to embed
Copy and paste this code into your site to embed