摘要:
传送门 代码 class MyStack { Queue<Integer> que1; Queue<Integer> que2; /** Initialize your data structure here. */ public MyStack() { que1 = new LinkedList< 阅读全文
摘要:
传送门 代码 class CQueue { Stack<Integer> stack1; Stack<Integer> stack2; public CQueue() { stack1 = new Stack<>(); stack2 = new Stack<>(); } public void ap 阅读全文
摘要:
传送门 代码 class Solution { private int ans = 1; public int diameterOfBinaryTree(TreeNode root) { dfs(root); return ans - 1; } public int dfs(TreeNode roo 阅读全文
摘要:
传送门 代码 class Solution { public List<List<Integer>> levelOrderBottom(TreeNode root) { List<List<Integer>> ans = new LinkedList<>(); if(root == null) re 阅读全文