• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
many-bucket
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 2 3 4 下一页
2025年6月16日
hot100之回溯上
摘要: 全排列(046) class Solution { List<List<Integer>> res = new ArrayList<>(); public List<List<Integer>> permute(int[] nums) { int n = nums.length; List<Inte 阅读全文
posted @ 2025-06-16 13:54 crhl-yy 阅读(34) 评论(0) 推荐(0)
2025年6月15日
hot100之图论
摘要: 岛屿数量(200) class Solution { public int numIslands(char[][] grid) { int res = 0; int m = grid.length; int n = grid[0].length; for (int i = 0; i < m ; i+ 阅读全文
posted @ 2025-06-15 14:04 crhl-yy 阅读(23) 评论(0) 推荐(0)
2025年6月14日
hot100之二叉树下
摘要: 二叉树的右视图(199) class Solution { List<Integer> res = new ArrayList<>(); public List<Integer> rightSideView(TreeNode root) { dfs(root, 0); return res; } p 阅读全文
posted @ 2025-06-14 14:23 crhl-yy 阅读(21) 评论(0) 推荐(0)
2025年6月13日
为什么说一个中文占三个字节
摘要: 缘由 在学习java基础时 对于s2,一个中文占用3个字节**,21845个正好占用65535个字节,而且字符串长度是21845,长度和存储也都没超过限制,所以可以编译通过 后来发现这句话是错的, java中char的存储是 LATIN-1(1字节) OR UTF-16(2字节) 但是引出了我对 U 阅读全文
posted @ 2025-06-13 15:16 crhl-yy 阅读(99) 评论(0) 推荐(0)
2025年6月12日
hot100之二叉树上
摘要: 二叉树的中序队列(094) 先看代码 class Solution { public List<Integer> inorderTraversal(TreeNode root) { List<Integer> res = new ArrayList<>(); Stack<TreeNode> stac 阅读全文
posted @ 2025-06-12 19:22 crhl-yy 阅读(22) 评论(0) 推荐(0)
2025年6月11日
hot100之链表下
摘要: K个一组翻转链表(025) 先看代码 class Solution { public ListNode reverseKGroup(ListNode head, int k) { ListNode dummy = new ListNode(-1, head); ListNode prev = dum 阅读全文
posted @ 2025-06-11 15:22 crhl-yy 阅读(16) 评论(0) 推荐(0)
2025年6月10日
hot100之链表上
摘要: 相交链表(160) 先看代码 public class Solution { public ListNode getIntersectionNode(ListNode headA, ListNode headB) { ListNode p = headA; ListNode q = headB; w 阅读全文
posted @ 2025-06-10 13:02 crhl-yy 阅读(22) 评论(0) 推荐(0)
2025年6月9日
hot100之矩阵
摘要: 矩阵置零(073) 先看代码 class Solution { public void setZeroes(int[][] matrix) { boolean col0_flag = false; int row = matrix.length; int col = matrix[0].length 阅读全文
posted @ 2025-06-09 13:03 crhl-yy 阅读(11) 评论(0) 推荐(0)
2025年6月7日
hot100之数组
摘要: 最大子数组和(053) 先看代码 class Solution { public int maxSubArray(int[] nums) { int n = nums.length; int subSum = 0; int res = nums[0]; for (int i = 0; i < n; 阅读全文
posted @ 2025-06-07 13:07 crhl-yy 阅读(28) 评论(0) 推荐(0)
2025年6月6日
hot100之子串
摘要: 和为K的子数组(560) 先看代码 class Solution { public int subarraySum(int[] nums, int k) { int res = 0; int preSum = 0; Map<Integer, Integer> cnt = new HashMap<>( 阅读全文
posted @ 2025-06-06 05:31 crhl-yy 阅读(24) 评论(0) 推荐(0)
上一页 1 2 3 4 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3