基础算法
文章平均质量分 68
wlssing3290
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
堆排序,优先队列实现
小弟刚实现 忘指正原创 2014-03-21 20:27:07 · 909 阅读 · 1 评论 -
快速排序实现
#include #include #include using namespace std;//两个版本void show(vector &v){ vector::iterator pos; for(pos = v.begin();pos != v.end();pos++) cout<<*pos<<" "; cout<<endl;}//第一个原创 2014-03-22 18:36:29 · 714 阅读 · 0 评论 -
希尔排序
#include #include using namespace std;void swap(int & a,int & b){ a=a+b; b=a-b; a=a-b;}void print(vector & v){ vector::iterator pos; for(pos = v.begin();pos!=v.end();pos++)原创 2014-03-24 23:05:48 · 591 阅读 · 0 评论 -
选择排序(非冒泡排序)我也不懂了 第一个算冒泡排序了吗?
#include #include using namespace std;void swap(int & a,int & b){ a=a+b; b=a-b; a=a-b;}vector & bubbleSort(vector & v){ int n=v.size(); for(auto i =0;i < n;i++) for(auto原创 2014-03-24 19:15:31 · 979 阅读 · 1 评论 -
冒泡排序(正宗点吧)
#include #include using namespace std;void swap(int & a,int & b){ a=a+b; b=a-b; a=a-b;}vector & bubbleSort(vector & v){ int n=v.size(); int flag; for(auto i =0;i < n;i++)原创 2014-03-24 23:40:22 · 714 阅读 · 0 评论 -
KMP算法
#include using namespace std;void originalMatch(char* o,char* m){ int original = strlen(o); int match = strlen(m); if (match > original||match ==0||original == 0) { cout<<"length is incorrec原创 2014-04-12 15:11:48 · 690 阅读 · 0 评论
分享