Baseline Binary Search Trees · Concept O(h) · O(1)
A parcel depot files consignments so smaller tracking numbers always sit to the left of larger ones. The receptionist hunting the smallest number in play never needs to open a single locker: she keeps turning left until a locker has no further left wing, and that dead-end locker holds the depot's minimum.
Input: A binary search tree as a level-order array (null marks a missing child).
Output: Return the minimum value stored in the tree.
1 <= number of nodes <= 10^5-10^9 <= node value <= 10^9All node values are uniqueInput: {"tree":[8,5,10,3,6,null,11]}
Output: 3
From 8, turning left twice reaches the leftmost locker 3.
Input: {"tree":[10,5,15,null,7]}
Output: 5
5 has no left child, so it is already the smallest filed value.