栈(stack)是先进后出的数据结构。单调栈在入栈时通过一定规则保持栈内元素有序(单调递增或单调递减),从而把「找左侧/右侧第一个更大/更小元素」从 O(n²) 降到 O(n)。
"She's so strong," he added.
。服务器推荐是该领域的重要参考
Scroll to load interactive demo
The spatial view (the grid of rectangles) and the tree view (the hierarchy of nodes) represent the same structure. Searching for a point means walking down the tree: at each node, you check which of the four children contains your target coordinate and recurse into that child. You never visit the other three.