![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构与算法2021
Ilqjx
当下很忧郁啊
展开
-
折半插入排序
/** * @author upfly * @create 2021-06-18 16:50 */ public class InsertSort { /** * 折半插入排序(从小到大) * * @param arr */ public void insertSort(int[] arr) { for (int i = 1; i < arr.length; i++) { // 1、寻找插入位置原创 2021-06-18 17:12:40 · 75 阅读 · 0 评论 -
直接插入排序
/** * @author upfly * @create 2021-06-17 16:33 */ public class InsertSort { /** * 直接插入排序(从小到大) * * @param arr */ public void insertSort(int[] arr) { for (int i = 1; i < arr.length; i++) { // 如果当前元素小于有序原创 2021-06-17 16:52:51 · 57 阅读 · 0 评论 -
KMP算法
/** * @author upfly * @create 2021-06-16 19:20 */ public class KMP { /** * 计算 next 数组 * * @param p 模式串 * @return next 数组 */ public int[] getNext(String p) { int[] next = new int[p.length()]; next[0] = -1原创 2021-06-17 16:16:03 · 73 阅读 · 0 评论