Data Structures & Algorithms
Complete catalog of 99 interactive algorithm visualizers. Browse by data structure category or filter by difficulty.
Find the minimum element in a sorted rotated array in O(log n) time by comparing nums[mid] to nums[right].
Binary search to guess a secret picked number in range [1..n] in O(log n) using pre-defined guess() API feedback.
Binary search on integer speed k in range [1 .. max(piles)] to find the minimum eating speed to finish all piles within h hours.
Treat an m x n row-sorted matrix as a virtual 1D sorted array [0 .. m*n - 1] and perform binary search.
Find target index or insertion position in sorted array using binary search [left, right].
Find target index in a rotated sorted array in O(log n) time by finding the pivot (minimum element) and binary searching the target segment.
Binary search on candidate ship capacity in range [max(weights) .. sum(weights)] to find minimum capacity feasible within D days.
