Leetcode84. Histogram largest rectangle (monotone Stack)

The largest rectangle 84. Histogram

Front

Monotonous stack

practice

  • Rectangular sections consisting of continuous, that is to look at a minimum, to obtain a first small left of each position its height, the right side is also the same token, this block as a minimum limit. Require two monotonous stack

  • Monotonically incrementing the stack maintenance intervals, each pop stack is not satisfied, the way to use this stack and calculates the current position to cover the length of the stack is used to calculate. Only once monotonous stack

Guess you like

Origin www.cnblogs.com/y2823774827y/p/11261446.html