class CQueue { Stack<Integer> stack1; Stack<Integer> stack2; public CQueue() { stack1 = new Stack(); stack2 = new...
class Solution { public ListNode deleteNode(ListNode head, int val) { ListNode myHead = new ListNode(-1); myHead.next =...
剑指 Offer 27. 二叉树的镜像 /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; *...
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; *...
剑指 Offer 30. 包含min函数的栈 class MinStack { Stack<Integer> stack1; Stack<Integer> stack2; /** initialize your data structure...
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val =...
剑指 Offer 32 - II. 从上到下打印二叉树 II class Solution { public List<List<Integer>> levelOrder(TreeNode root) { Queue<TreeNode>...
剑指 Offer 32 - III. 从上到下打印二叉树 III /** * Definition for a binary tree node. * public class TreeNode { * int val; *...