圖像來源,Getty Images
栈(stack)是先进后出的数据结构。单调栈在入栈时通过一定规则保持栈内元素有序(单调递增或单调递减),从而把「找左侧/右侧第一个更大/更小元素」从 O(n²) 降到 O(n)。
。关于这个话题,WPS下载最新地址提供了深入分析
-storages: list[Storage]
添加图片注释,不超过 140 字(可选)
After more back-and-forth with design nitpicks and more features to add, the package is feature complete. However, it needs some more polish and a more unique design before I can release it, and I got sidetracked by something more impactful…