摘要: 题目如图: 链接: 解法一: 思路: 1.构造链表栈 2.在每次push的时候检查最小值变动 3.在每次pop的时候遍历检查最小值变动 4.top和getMin直接返回 代码: public class leetcode155 { static class Stack { Node head; No 阅读全文
posted @ 2020-11-12 16:57 ComgLq 阅读(57) 评论(0) 推荐(0)