11 2020 档案

摘要:QUESTION: SOURCE: http://acm.hdu.edu.cn/showproblem.php?pid=1022 MENTALITY The train station is a model of stack, which operations can only occur at t 阅读全文
posted @ 2020-11-16 16:33 ComgLq 阅读(73) 评论(0) 推荐(0)
摘要:题目如图: 链接: 解法一: 思路: 1.构造链表栈 2.在每次push的时候检查最小值变动 3.在每次pop的时候遍历检查最小值变动 4.top和getMin直接返回 代码: public class leetcode155 { static class Stack { Node head; No 阅读全文
posted @ 2020-11-12 16:57 ComgLq 阅读(58) 评论(0) 推荐(0)