06 2021 档案
摘要:public static void main(String[] args) { System.out.println(JSON.toJSON(kingRing(41, 3))); } //链表实现-删除效率高-不需要复制或移动元素 public static Integer[] kingRing(
阅读全文
摘要:public static void main(String[] args) { int[] value = {100, 150, 350}; int[] weight = {1, 4, 3}; System.out.println(dynamic(5, value, weight)); } /**
阅读全文
摘要:import lombok.extern.slf4j.Slf4j; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * @author: small-sunshine * @Descrip
阅读全文
摘要:/** * 是否可以构成一个三角形 * 1、一边存在小于或等于0的数据不能构成三角形 * 2、有任意一个满足:两边之和小于或等于第三边的情况都不能构成三角形 * * @param a * @param b * @param c * @return boolean */ public static b
阅读全文
摘要:import java.io.*; import java.text.DecimalFormat; /** * @author: small sunshine * @Description: * @date: 2021/6/20 10:04 上午 */ public class ScoreDescS
阅读全文
摘要:/** * 冒泡排序-稳定的,两个相同的数-相对位置不变 * * @param num * @return */ public static int[] bubbleSort(int[] num) { if (Objects.isNull(num) || num.length <= 1) { ret
阅读全文
摘要:import com.alibaba.fastjson.JSON; import lombok.extern.slf4j.Slf4j; /** * @author: Small sun shine * @Description: * @date: 2021/6/20 9:40 上午 */ @Slf4
阅读全文
摘要://递归,累计+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
阅读全文
摘要:/** * 双指针-数组反转 * * @param array * @return */ public static int[] coverArray(int[] array) { if (array == null && array.length == 0) { return array; } i
阅读全文
摘要:public class StrCutDown { /** * 字符串压缩范围[a-zA-Z] 输入如:aaabbbccca =>> a3b3c3a1 * 压缩后的字符串要小于原字符串,否则返回原字符串 * @param args */ public static void main(String[
阅读全文
摘要:@Slf4j public class AgeTotal { public static String file = "/Desktop/age.txt"; public static int total = 10000 * 10000; public static int maxAge = 180
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文

浙公网安备 33010602011771号