摘要:
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 阅读全文
摘要:
参考ArrayBlockingQueue import java.util.ArrayList; import java.util.List; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks 阅读全文
摘要:
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 阅读全文
摘要:
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) { 阅读全文
摘要:
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 阅读全文
摘要:
static class Node { private Node next; private int val; public Node(Node next, int val) { this.next = next; this.val = val; } public Node getNext() { 阅读全文
摘要:
判断单链表是否有环,如果有环的话,具体再有环的节点是哪个? static class Node { private Node next; private int val; public Node(Node next, int val) { this.next = next; this.val = v 阅读全文
摘要:
通过快慢指针方式对数组进行去重 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 阅读全文