Tagged articles

peak element

2 articles · Page 1 of 1
Nullbody Notes
Nullbody Notes
Nov 15, 2023 · Fundamentals

Binary Search Solution for LeetCode 162: Find Peak Element

This article explains how to solve LeetCode problem 162 (Find Peak Element) in O(log n) time using a binary‑search approach, detailing the three possible cases, providing pseudocode, and presenting a complete Go implementation that handles boundary conditions as negative infinity.

AlgorithmGoLeetCode
0 likes · 4 min read
Binary Search Solution for LeetCode 162: Find Peak Element