![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构与算法分析
walker_storage
这个作者很懒,什么都没留下…
展开
-
快速排序
基本思想:快速排序是基于分治策略的一种排序算法。选择一个基准元素,然后通过排序将数据分割成独立的三部分,其中一部分的所有数据比另一部分的所有数据都要小,中间为基本点。然后再按此方法分别递归对两部分进行排序,以达到整体有序的过程。对于输入的数组a[p:r]按以下3个步骤进行排序: 1.分解:以a[q]为基准元素,将a[p:r]分为a[p:q-1],a[q],a[q+1:r]。其中a[p:q-1]中任原创 2017-08-19 14:15:31 · 231 阅读 · 0 评论 -
KMP
#include <iostream>#include <string.h>#include <stdio.h>using namespace std;char str1[1000001];char str2[1000001];void getNextArray(char *str, int *next) { int len = str...原创 2018-12-29 00:45:24 · 137 阅读 · 0 评论