Question DSA-SRCH-0033
EasyHow fast can you search for a value in a sorted array that has been rotated (such as [15, 18, 2, 3, 6, 12])?
- A.
O(n²)
- B.
O(1)
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Searching and Binary Search question
How fast can you search for a value in a sorted array that has been rotated (such as [15, 18, 2, 3, 6, 12])?
O(n²)
O(1)
Sign up free to see the answer and a step-by-step explanation.
Only O(n)
O(log n), with a modified binary search