Skip to content

Commit 082fafa

Browse files
authored
Update Readme.md
1 parent f59649b commit 082fafa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • Stack/084.Largest-Rectangle-in-Histogram

Stack/084.Largest-Rectangle-in-Histogram/Readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
高级一点的方法只需要1-pass。维护一个递增的单调栈。当新元素i比栈顶元素小时,说明栈顶元素的nextSmaller就是i,而栈顶元素的prevSmaller就是栈的次顶元素。
88

9-
其他的技巧:  
10-
----------
9+
#### 其他的技巧:
10+
1111
在height数组末添加元素0,是为了保证最后强制回溯。在height数组首端添加元素0,是为了便于处理s.pop()之后栈为空的特殊情况;这样处理后永远不会栈空。
1212

1313

0 commit comments

Comments
 (0)