摘要: 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 阅读(201) 评论(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 阅读(158) 评论(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 阅读(218) 评论(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 阅读(159) 评论(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 阅读(143) 评论(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 阅读(127) 评论(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 阅读(262) 评论(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 阅读(415) 评论(0) 推荐(0) 编辑