![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
剑指offer基础版
亿咕
Life is a trade-off
展开
-
【坚持】Leetcode《剑指offer》学习计划Day02
剑指 Offer 06. 从尾到头打印链表class Solution { public int[] reversePrint(ListNode head) { Stack<ListNode> s = new Stack<ListNode>(); while(head!=null){ s.push(head); head = head.next; } int s原创 2021-08-26 08:29:09 · 172 阅读 · 0 评论 -
【坚持】Leetcode《剑指offer》学习计划Day01
剑指 Offer 09. 用两个栈实现队列这道题,对答案有点困惑,为啥要当辅助栈的数据煤油了,才进行主栈传入数据?class CQueue { Deque<Integer> s1; Deque<Integer> s2; public CQueue() { s1 = new LinkedList<Integer>();//LinkedList来做Stack的容器,因为LinkedList实现了Deque接口,所以原创 2021-08-25 17:40:30 · 232 阅读 · 0 评论