栈(stack)是先进后出的数据结构。单调栈在入栈时通过一定规则保持栈内元素有序(单调递增或单调递减),从而把「找左侧/右侧第一个更大/更小元素」从 O(n²) 降到 O(n)。
Essential digital access to quality FT journalism on any device. Pay a year upfront and save 20%.
。业内人士推荐爱思助手下载最新版本作为进阶阅读
Indulge in the Darkness, hosted by The Book Club Fest, is offering participants the chance to download dark romance books without spending anything. Everything that you download is yours to keep forever, so there's no need to hold back. Dive into the world of dark romance with this limited-time event.
Kevin Church/BBC News