上一页 1 2 3 4 5 6 7 8 9 ··· 36 下一页
摘要: IP地址 Java的InetAddress类可以获取IP地址 import java.net.InetAddress; import java.net.UnknownHostException; public class Main { public static void main(String[] 阅读全文
posted @ 2022-03-14 11:48 振袖秋枫问红叶 阅读(77) 评论(0) 推荐(0)
摘要: 计算机网络 计算机网络是指将地理位置不同的具有独立功能的多台计算机及其外部设备,通过通信线路连接起来,在网络操作系统、网络管理软件及网络通信协议的管理和协调下,实现资源共享和信息传递的计算机系统 网络通信的要素 C/S架构(客户/服务器模式)和B/S架构(浏览器/服务器模式) IP地址、端口号:定位 阅读全文
posted @ 2022-03-14 11:08 振袖秋枫问红叶 阅读(23) 评论(0) 推荐(0)
摘要: 经常创建、销毁线程对性能影响很大,因此可以提前创建多个线程放入线程池,使用时直接获取,使用完放回池中 好处:使用线程池可以提高响应速度、降低资源消耗、便于线程管理 import java.util.concurrent.ExecutorService; import java.util.concur 阅读全文
posted @ 2022-03-13 22:47 振袖秋枫问红叶 阅读(43) 评论(0) 推荐(0)
摘要: 动态规划 class Solution { public int longestPalindromeSubseq(String s) { /** * 类似于《647. 回文子串》 * dp[i][j]定义为区间为[i, j]内最长的回文子串长度 * 初始化每个字符就是一个回文串,即每个dp[i][i 阅读全文
posted @ 2022-03-04 18:06 振袖秋枫问红叶 阅读(38) 评论(0) 推荐(0)
摘要: 动态规划 class Solution { public int minDistance(String word1, String word2) { /** * 和《583. 两个字符串的删除操作》一模一样 * 只有一个地方不一样 */ int[][] dp = new int[word1.leng 阅读全文
posted @ 2022-03-04 17:17 振袖秋枫问红叶 阅读(29) 评论(0) 推荐(0)
摘要: 动态规划 class Solution { public int minDistance(String word1, String word2) { /** * dp[i][j]定义为以word1[i - 1]结尾的字符串,和以word2[j - 1]结尾的字符串,要想相等需要删除的最小元素个数 * 阅读全文
posted @ 2022-03-04 17:04 振袖秋枫问红叶 阅读(58) 评论(0) 推荐(0)
摘要: 动态规划 class Solution { public int numDistinct(String s, String t) { /** * 结合《1143. 最长公共子序列》和《392. 判断子序列》 * dp[i][j]定义为以s[i - 1]结尾的字符串s中出现以t[j - 1]结尾的字符 阅读全文
posted @ 2022-03-04 16:44 振袖秋枫问红叶 阅读(41) 评论(0) 推荐(0)
摘要: 完全背包 import java.util.List; class Solution { public boolean wordBreak(String s, List<String> wordDict) { /** * dp[j]定义为长度为j的字符串是否可以由字典中的子串组成,即[0, j - 阅读全文
posted @ 2022-03-04 15:11 振袖秋枫问红叶 阅读(30) 评论(0) 推荐(0)
摘要: 动态规划 class Solution { public int countSubstrings(String s) { /** * dp[i][j]定义为区间为[i, j]的子串是否是回文串 */ boolean[][] dp = new boolean[s.length()][s.length( 阅读全文
posted @ 2022-03-01 13:02 振袖秋枫问红叶 阅读(30) 评论(0) 推荐(0)
摘要: 动态规划 class Solution { public boolean isSubsequence(String s, String t) { /** * 和《1143. 最长公共子序列》一样 */ int[][] dp = new int[s.length() + 1][t.length() + 阅读全文
posted @ 2022-03-01 10:31 振袖秋枫问红叶 阅读(30) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 36 下一页