VOOZH about

URL: https://www.geeksforgeeks.org/dsa/find-bitonic-point-given-bitonic-sequence/

⇱ Find bitonic point in given bitonic sequence - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Find bitonic point in given bitonic sequence

Last Updated : 11 Feb, 2025

You are given a Bitonic Sequence, the task is to find Bitonic Point in it. A Bitonic Sequence is a sequence of numbers which is first strictly increasing then after a point strictly decreasing.
A Bitonic Point is a point in bitonic sequence before which elements are strictly increasing and after which elements are strictly decreasing.
Note:- Given Sequence will always be a valid bitonic sequence.
Examples:

Input: arr[] = {8, 10, 100, 200, 400, 500, 3, 2, 1}
Output: 500

Input: arr[] = {10, 20, 30, 40, 30, 20}
Output: 40

Input: arr[] = {60, 70, 120, 100, 80}
Output: 120

[Naive Approach] Using Linear Search - O(n) Time and O(1) Space

A simple approach is to iterate through the array and keep track of the maximum element occurred so far. once the traversal is complete, return the maximum element.


Output
500

[Expected Approach] Using Binary Search - O(logn) Time and O(1) Space

The input array follows a monotonic pattern. If an element is smaller than the next one, it lies in the increasing segment of the array, and the maximum element will definitely exist after it. Conversely, if an element is greater than the next one, it lies in the decreasing segment, meaning the maximum is either at this position or earlier. Therefore, we can use binary search to efficiently find the maximum element in the array.



Output
500
Comment
Article Tags: