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之二叉树上
二叉树的中序队列(094) 先看代码 class Solution { public List<Integer> inorderTraversal(TreeNode root) { List<Integer> res = new ArrayList<>(); Stack<TreeNode>...
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...
hot100之回溯上
全排列(046) class Solution { List<List<Integer>> res = new ArrayList<>(); public List<List<Integer>> permute(int[] nums) { int n = nums.length; List&l...
三级缓存解决了循环依赖问题?别被骗了,一级缓存就够了!
方案导入 循环依赖是什么 构造出两个对象A和B,A中有成员B,B中有成员A,换成代码就是这样子。 @Component public class A { @Autowired private B b; } @Component public class B { @Autowire...
为什么说一个中文占三个字节
缘由 在学习java基础时 对于s2,一个中文占用3个字节**,21845个正好占用65535个字节,而且字符串长度是21845,长度和存储也都没超过限制,所以可以编译通过 后来发现这句话是错的, java中char...