上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 26 下一页
public class ThreadTest { public static volatile int count = 0; public static AtomicInteger atomicCount = new AtomicInteger(0); public static void mai Read More
posted @ 2022-06-23 23:02 活出自己范儿 Views(37) Comments(0) Diggs(0)
1、获取CPU核数 Runtime.getRuntime().availableProcessors(); 执行结果:8 Read More
posted @ 2022-06-23 22:52 活出自己范儿 Views(112) Comments(0) Diggs(0)
1、左右碰撞指针,类似于二分法查找 1 /** 2 * 查找是否存在目标值 时间复杂度 O(logN) 3 * 有序的数组,查可以这样用 4 * @param array 5 * @param target 6 * @return 7 */ 8 public static boolean findT Read More
posted @ 2021-12-28 14:02 活出自己范儿 Views(47) Comments(0) Diggs(0)
1、栈,LIFO-后进先出数据结构。 /** * 给定一个只包括 '(',')','{','}','[',']'的字符串 s ,判断字符串是否有效。 * 有效字符串需满足: * 左括号必须用相同类型的右括号闭合。 * 左括号必须以正确的顺序闭合。 * * 示例 1: * 输入:s = "()" * Read More
posted @ 2021-12-28 13:52 活出自己范儿 Views(23) Comments(0) Diggs(0)
该文被密码保护。 Read More
posted @ 2021-12-03 14:47 活出自己范儿 Views(0) Comments(0) Diggs(0)
1、定时任务-相关代码 @Component @EnableScheduling public class PrintTask { @Value("${task.switch}") private String taskSwitch; //统计器 private volatile int count Read More
posted @ 2021-09-20 22:25 活出自己范儿 Views(812) Comments(0) Diggs(0)
public static boolean isLooped(int num) { StringBuilder strBuilder = new StringBuilder(String.valueOf(num)); int l = 0; //左指针 int r = strBuilder.lengt Read More
posted @ 2021-07-09 13:38 活出自己范儿 Views(49) Comments(0) Diggs(0)
public static void main(String[] args) { Tree treeG = new Tree('G', null, null); Tree treeD = new Tree('D', null, null); Tree treeF = new Tree('F', nu Read More
posted @ 2021-07-01 11:25 活出自己范儿 Views(193) Comments(0) Diggs(0)
public static void main(String[] args) { System.out.println(JSON.toJSON(kingRing(41, 3))); } //链表实现-删除效率高-不需要复制或移动元素 public static Integer[] kingRing( Read More
posted @ 2021-06-29 11:41 活出自己范儿 Views(38) Comments(0) Diggs(0)
public static void main(String[] args) { int[] value = {100, 150, 350}; int[] weight = {1, 4, 3}; System.out.println(dynamic(5, value, weight)); } /** Read More
posted @ 2021-06-28 16:48 活出自己范儿 Views(33) Comments(0) Diggs(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 26 下一页