Question DSA-SRCH-0034
EasyHow fast can a peak element (one not smaller than its neighbours) be found in an array?
- A.
O(log n), using binary search
- 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 a peak element (one not smaller than its neighbours) be found in an array?
O(log n), using binary search
O(1)
Sign up free to see the answer and a step-by-step explanation.
O(n log n)
O(n²)