Search in Rotated Sorted Array | Dataford Interview Questions - Dataford - Ace your Interview
Search in Rotated Sorted Array
Medium
Coding
Asked at 1 company1ArraysRecursionSearching
Also asked at
Problem
Given a rotated sorted array of distinct integers, implement a function that returns the index of a target value or -1 if it is not present. The solution must run in O(log n) time, so a linear scan is not acceptable.
Problem
Given a rotated sorted array of distinct integers, implement a function that returns the index of a target value or -1 if it is not present. The solution must run in O(log n) time, so a linear scan is not acceptable.
Practice PythonPython 3.10
Open on desktop for the full Python editor with syntax highlighting and autocomplete.