摘要: 传送门 代码 class MyStack { Queue<Integer> que1; Queue<Integer> que2; /** Initialize your data structure here. */ public MyStack() { que1 = new LinkedList< 阅读全文
posted @ 2021-01-01 19:37 lukelmouse 阅读(61) 评论(0) 推荐(0) 编辑
摘要: 传送门 代码 class CQueue { Stack<Integer> stack1; Stack<Integer> stack2; public CQueue() { stack1 = new Stack<>(); stack2 = new Stack<>(); } public void ap 阅读全文
posted @ 2021-01-01 19:24 lukelmouse 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 传送门 代码 class Solution { private int ans = 1; public int diameterOfBinaryTree(TreeNode root) { dfs(root); return ans - 1; } public int dfs(TreeNode roo 阅读全文
posted @ 2021-01-01 19:20 lukelmouse 阅读(60) 评论(0) 推荐(0) 编辑
摘要: 传送门 代码 class Solution { public List<List<Integer>> levelOrderBottom(TreeNode root) { List<List<Integer>> ans = new LinkedList<>(); if(root == null) re 阅读全文
posted @ 2021-01-01 19:12 lukelmouse 阅读(38) 评论(0) 推荐(0) 编辑