![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JAVA
西工大苗苗
这个作者很懒,什么都没留下…
展开
-
解决JAVA中字符串连接过慢的问题
如下的字符串连接在JAVA中是很慢的 // "static void main" must be defined in a public class. public class Main { public static void main(String[] args) { String s = ""; int n = 10000; for (...原创 2019-07-18 19:41:30 · 465 阅读 · 0 评论 -
*leetcode - 28 实现Strstr()
两个字符串,需要判断第二个字符串是否为第一个字符串的子字符串,如果是的话返回子字符串所在位置第一个元素的索引 推荐解法: KMP算法,现在还没有搞懂,已标星 当前解法: 当前为逐个比对以及回溯的方法,效率比较低,复杂度为平方 class Solution { public int strStr(String haystack, String needle) { if(nee...原创 2019-08-12 15:50:00 · 88 阅读 · 0 评论