Skip to content

Latest commit

 

History

History
14 lines (9 loc) · 380 Bytes

bitonicPoint.md

File metadata and controls

14 lines (9 loc) · 380 Bytes

Bitonic Point Detection

Given an array of integers that is initially increasing and then decreasing (a bitonic sequence), find the index of the peak (the bitonic point).

Hint: There's a solution that is O(n) and one that is O(log(n))!

Example:

Input: [2, 3, 4, 5, 2, 1]

Output: 3

Source