上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 35 下一页
摘要: 判断单链表是否有环,如果有环的话,具体再有环的节点是哪个? 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 阅读(265) 评论(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 阅读(426) 评论(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 阅读(156) 评论(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 阅读(146) 评论(0) 推荐(0)
摘要: 给定一个包含非负整数的 m x n 网格,请找出一条从左上角到右下角的路径,使得路径上的数字总和为最小。 说明:每次只能向下或者向右移动一步。 举例: 输入: arr = [ [1,3,1], [1,5,1], [4,2,1] ] 输出: 7 解释: 因为路径 1→3→1→1→1 的总和最小。 pu 阅读全文
posted @ 2020-07-10 22:45 使用D 阅读(140) 评论(0) 推荐(0)
摘要: 一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为“Start” )。 机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角(在下图中标记为“Finish”)。 问总共有多少条不同的路径? public static int b() { int m = 1; int n 阅读全文
posted @ 2020-07-10 19:02 使用D 阅读(145) 评论(0) 推荐(0)
摘要: 给定一个字符串 s 和一个非空字符串 p,找到 s 中所有是 p 的字母异位词的子串,返回这些子串的起始索引?输入:s: "cbaebabacd" p: "abc"输出:[0, 6]解释:起始索引等于 0 的子串是 "cba", 它是 "abc" 的字母异位词。起始索引等于 6 的子串是 "bac" 阅读全文
posted @ 2020-07-10 11:53 使用D 阅读(210) 评论(0) 推荐(0)
摘要: 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度?输入: "abcabcbb"输出: 3 解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。 public static void main(String[] args) { System.out.println(t()) 阅读全文
posted @ 2020-07-10 11:17 使用D 阅读(228) 评论(0) 推荐(0)
摘要: 给定一个字符串 S 和一个字符串 T,请在 S 中找出包含 T 所有字母的最小子串? 输入: S = "ADOBECODEBANC", T = "ABC" 输出: "BANC" public static void main(String[] args) { System.out.println(t 阅读全文
posted @ 2020-07-10 10:54 使用D 阅读(173) 评论(0) 推荐(0)
摘要: jdk 1.8 -Xms6G -Xmx6G -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=80 -XX:+CMSScavengeBeforeRemark -X 阅读全文
posted @ 2020-07-09 15:45 使用D 阅读(4) 评论(0) 推荐(0)
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 35 下一页
点击右上角即可分享
微信分享提示