Software Engineer's Blog

Blog posts — page 19

Why is Binary Search O(log n)?

Coding Interview

Why is Binary Search O(log n)?

Jason Yang · 02 Dec, 2025

Binary Search runs in O(log n) because it halves the search space every step. Here's the intuition, the math proof, and how it compares to linear search.

153. Find Minimum in Rotated Sorted Array

Coding Interview

153. Find Minimum in Rotated Sorted Array

Jason Yang · 02 Dec, 2025

Find Minimum in Rotated Sorted Array (LeetCode 153): the O(log n) binary search that locates the rotation pivot, explained step by step with examples.