摘要:
739. 每日温度 LeetCode_739 相似题目:单调栈结构(进阶) 题目描述 代码实现 class Solution { public int[] dailyTemperatures(int[] T) { int n = T.length; Stack<Integer> sta = new 阅读全文
摘要:
739. 每日温度 LeetCode_739 相似题目:单调栈结构(进阶) 题目描述 代码实现 class Solution { public int[] dailyTemperatures(int[] T) { int n = T.length; Stack<Integer> sta = new 阅读全文
摘要:
单调栈结构(进阶) 单调栈结构(进阶) 题目描述 方法一:暴力法 @Test public void main1(){ Scanner cin = new Scanner(System.in); int n = cin.nextInt(); int[] nums = new int[n]; for( 阅读全文
摘要:
101. 对称二叉树 LeetCode_101 题目描述 方法一:递归法 /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; 阅读全文
摘要:
104. 二叉树的最大深度 LeetCode_104 题目描述 代码实现 /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; 阅读全文
摘要:
704. 二分查找 LeetCode_704 题目描述 代码实现 class Solution { public int search(int[] nums, int target) { int low = 0, high = nums.length - 1; while(low <= high){ 阅读全文