摘要:
https://leetcode-cn.com/problems/first-bad-version/ public int firstBadVersion(int n) { int left=0,right=n,mid; while (left<right){ mid = ((right-left 阅读全文
摘要:
public static int search(int[] nums, int target) { //双指针 int left=0,right=nums.length-1; int mid=0; int res = -1; while (left<=right){ //防止int溢出如果是写为( 阅读全文
摘要:
三个概念:最有子结构,边界,状态转化 https://www.cnblogs.com/cthon/p/9251909.html 爬楼梯问题 public static int getWay(int i) { if (i<1){ return 1; } if (i==1){ return 1; } i 阅读全文
摘要:
package cn.jiedada.controller; import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; public class TestABC { p 阅读全文