剑指offer(专项突击版)
文章平均质量分 52
算法题
棱镜7
这个作者很懒,什么都没留下…
展开
-
018.有效的回文
有效的回文原创 2022-06-14 21:47:08 · 1422 阅读 · 1 评论 -
068.查找插入位置--二分查找
文章目录一、code1.1 题目描述1.2 题解二、总结一、code1.1 题目描述地址1.2 题解class Solution { // 二分查找 public int searchInsert(int[] nums, int target) { int left = 0; int right = nums.length - 1; if(nums[left] > target) return 0; //左边界 i原创 2022-05-28 22:24:49 · 55 阅读 · 0 评论 -
002.二进制加法
文章目录一、code1.1 题目描述1.2 题解二、总结StringBuffer 和 StringBuilder 类一、code1.1 题目描述Leetcode地址1.2 题解class Solution { public String addBinary(String a, String b) { StringBuilder result = new StringBuilder(); int n = a.length() - 1; int原创 2022-05-21 17:29:02 · 67 阅读 · 0 评论 -
001.整数的除法
文章目录一、code1.1 题目描述1.2 题解二、总结一、code1.1 题目描述Leetcode地址1.2 题解class Solution { public int divide(int a, int b) { if(a == 0x80000000 && b == -1){ // 0x80000000为最小int型整数,即-2^31 return Integer.MAX_VALUE; } i原创 2022-05-19 21:49:14 · 159 阅读 · 0 评论