上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 36 下一页
摘要: static class Node { private Node next; private int val; public Node(Node next, int val) { this.next = next; this.val = val; } } public static void mai 阅读全文
posted @ 2020-07-14 22:08 使用D 阅读(211) 评论(0) 推荐(0)
摘要: 参考ArrayBlockingQueue import java.util.ArrayList; import java.util.List; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks 阅读全文
posted @ 2020-07-14 20:53 使用D 阅读(163) 评论(0) 推荐(0)
摘要: public static int a() { int target = 6; int[] a = {3, 3, 1, 3, 3, 7, -1}; int[] dp = new int[a.length + 1]; //初始化 dp[0] = 0; for (int i = 1; i < dp.le 阅读全文
posted @ 2020-07-14 10:42 使用D 阅读(222) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { int[] a = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; int startI = 0; int endI = a.length - 1; while (startI <= endI) { 阅读全文
posted @ 2020-07-14 00:36 使用D 阅读(166) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { int target = 10; int[] a = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; int startI = 0; int endI = a.length - 1; while (s 阅读全文
posted @ 2020-07-14 00:34 使用D 阅读(154) 评论(0) 推荐(0)
摘要: static class Node { private Node next; private int val; public Node(Node next, int val) { this.next = next; this.val = val; } public Node getNext() { 阅读全文
posted @ 2020-07-14 00:28 使用D 阅读(138) 评论(0) 推荐(0)
摘要: 判断单链表是否有环,如果有环的话,具体再有环的节点是哪个? static class Node { private Node next; private int val; public Node(Node next, int val) { this.next = next; this.val = v 阅读全文
posted @ 2020-07-14 00:22 使用D 阅读(269) 评论(0) 推荐(0)
摘要: 通过快慢指针方式对数组进行去重 public static void main(String[] args) { int[] a = {1, 1, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 7, 8, 9, 10, 11}; int startI = 0; int 阅读全文
posted @ 2020-07-14 00:03 使用D 阅读(432) 评论(0) 推荐(0)
摘要: 获得素数:只能被1与自己整除的正整数? public static void main(String[] args) { boolean[] n = new boolean[100]; Arrays.fill(n, true); for (int i = 2; i * i < n.length; i 阅读全文
posted @ 2020-07-13 23:50 使用D 阅读(159) 评论(0) 推荐(0)
摘要: 挖金矿(背包问题) /** * RUN THIS */ public static void main(String[] args) { System.out.println(d()); } public static int d() { int[] person = {5, 5, 3, 4, 3} 阅读全文
posted @ 2020-07-11 22:33 使用D 阅读(149) 评论(0) 推荐(0)
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 36 下一页