hot100之动态规划下
最长递增子序列(300) class Solution { public int lengthOfLIS(int[] nums) { int res = 1; for(int num : nums){ int idx = findLarge(nums, res, num); nums[idx] = num; if (idx == res) ...
hot100之回溯上
全排列(046) class Solution { List<List<Integer>> res = new ArrayList<>(); public List<List<Integer>> permute(int[] nums) { int n = nums.length; List&l...
hot100之二叉树上
二叉树的中序队列(094) 先看代码 class Solution { public List<Integer> inorderTraversal(TreeNode root) { List<Integer> res = new ArrayList<>(); Stack<TreeNode>...
hot100之链表下
K个一组翻转链表(025) 先看代码 class Solution { public ListNode reverseKGroup(ListNode head, int k) { ListNode dummy = new ListNode(-1, head); ListNode prev = dummy; while(prev.next...
hot100之双指针
移动0(283) 先看代码 class Solution { public void moveZeroes(int[] nums) { int idx0 = 0; for (int idx = 0; idx < nums.length; idx++){ if(nums[idx] != 0){ int temp = nums[idx0]; n...
几分钟了解下java虚拟机–02
几分钟应该看不完,私密马赛, 俺是标题党 既然来了, 看看吧, 球球你了 Java类加载器 类的生命周期和加载过程 加载 加载所有的.class文件/jar文件/网络流 →字节流 (JVM 与java.lang.classLoader...
LeetCode周简报1
每日一题 Day1 最长和谐子序列(594) class Solution { public int findLHS(int[] nums) { Arrays.sort(nums); int lef = 0; int res = 0; for (int rig = 0; rig < nums.length; rig++){ whi...