上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 26 下一页
import com.alibaba.fastjson.JSON; import lombok.extern.slf4j.Slf4j; /** * @author: Small sun shine * @Description: * @date: 2021/6/20 9:40 上午 */ @Slf4 Read More
posted @ 2021-06-20 10:17 活出自己范儿 Views(33) Comments(0) Diggs(0)
//递归,累计+1,非尾递归 public static int cap(int n) { if (n == 1) { return 1; } return cap((n - 1)) + 1; } //递归,累计+1,尾递归 public static int capTail(int n, int Read More
posted @ 2021-06-19 18:35 活出自己范儿 Views(80) Comments(0) Diggs(0)
/** * 双指针-数组反转 * * @param array * @return */ public static int[] coverArray(int[] array) { if (array == null && array.length == 0) { return array; } i Read More
posted @ 2021-06-17 16:01 活出自己范儿 Views(44) Comments(0) Diggs(0)
public class StrCutDown { /** * 字符串压缩范围[a-zA-Z] 输入如:aaabbbccca =>> a3b3c3a1 * 压缩后的字符串要小于原字符串,否则返回原字符串 * @param args */ public static void main(String[ Read More
posted @ 2021-06-16 13:41 活出自己范儿 Views(279) Comments(0) Diggs(0)
@Slf4j public class AgeTotal { public static String file = "/Desktop/age.txt"; public static int total = 10000 * 10000; public static int maxAge = 180 Read More
posted @ 2021-06-15 16:54 活出自己范儿 Views(84) Comments(0) Diggs(0)
public class DoublePointer { public static int[] a = new int[]{1, 3, 4, 9}; public static int[] b = new int[]{0, 3, 4, 4}; public static void main(Str Read More
posted @ 2021-06-15 16:09 活出自己范儿 Views(344) Comments(0) Diggs(0)
public class RepeatBase { public static int[] num = {1,0,8,4,5,6,2,8,1,6}; public static void main(String[] args) { // System.out.println(repeatCheckB Read More
posted @ 2021-06-15 14:06 活出自己范儿 Views(146) Comments(0) Diggs(0)
1、二分法查询 public static void main(String[] args) { int[] array = new int[]{1, 4, 3, 2, 6, 5, 8, 9, 7}; int target = 9; boolean flag = findTarget(target, Read More
posted @ 2021-03-24 23:01 活出自己范儿 Views(64) Comments(0) Diggs(0)
最近在整理代码时,遇到数据库变更,向数据库添加记录,中文读取或存入时变为???。本地MySQL数据库的字符集设置的是utf-8,IDE中项目的字符集也是utf-8,所以在切换数据库之前未发现问题。遇到这个问题后排查了一段时间,最后是在MySQL连接数据库url的参数中加了characterEncod Read More
posted @ 2021-02-26 17:50 活出自己范儿 Views(1282) Comments(0) Diggs(0)
1、String 与 list 相互转换 List<String> str = new ArrayList<>(); str.add("small");str.add("sun");str.add("shine"); String joinStr = String.join(",", str); S Read More
posted @ 2021-02-03 17:01 活出自己范儿 Views(2017) Comments(0) Diggs(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 26 下一页