08 2024 档案

摘要:class Solution { public int[] searchRange(int[] nums, int target) { int x = left(nums, target); if (x == -1) { return new int[] { -1, -1 }; }else{ ret 阅读全文
posted @ 2024-08-27 20:29 张碧晨 阅读(4) 评论(0) 推荐(0) 编辑
摘要:1.Java的二分查找 public int searchInsert(int[] nums, int target) { int i = 0, j = nums.length - 1; while (i <= j) { int m = (i + j) >>> 1; if (target < num 阅读全文
posted @ 2024-08-27 20:14 张碧晨 阅读(3) 评论(0) 推荐(0) 编辑
摘要:1.基础版 public int search(int[] nums, int target) { int i = 0, j = nums.length - 1; while (i <= j) { int middle = (i + j) >>> 1; if (target < nums[middl 阅读全文
posted @ 2024-08-27 19:53 张碧晨 阅读(4) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示