- 博客(11)
- 收藏
- 关注
原创 顺序表
#include #include #include #include using namespace std; #define sizelist 100 #define listincrease 10 #define error -1 #define ok 0 typedef struct { int *data; int length; int listsize; }
2017-11-24 20:37:20 159
原创 桶排序
#include #include #include #include using namespace std; int main() { int *p,q[10005]; int n; p=new int[10005]; memset(q,0,sizeof(q)); cout<<"输入序列长度:"<<endl; cin>>n; int i=
2017-11-22 20:28:49 145
原创 直接插入排序
#include #include #include using namespace std; typedef struct { int *r; int length; } sqlist; void createlink(sqlist &L) { int n; L.length=0; cout<<"输入链表长度:"<<endl; cin>>n;
2017-11-22 20:14:16 163
原创 折半排序
#include #include #include using namespace std; typedef struct { int *r; int length; } sqlist; void createlink(sqlist &L) { int n; L.length=0; cout<<"输入链表长度:"<<endl; cin>>n;
2017-11-22 20:10:02 225
原创 快速排序
#include #include #include using namespace std; typedef struct { int *r; int length; } sqlist; void createlink(sqlist &L) { int n; L.length=0; cout<<"输入链表长度:"<<endl; cin>>n;
2017-11-22 20:02:37 157
原创 希尔排序
#include #include #include using namespace std; typedef struct { int *r; int length; } sqlist; void createlink(sqlist &L) { int n; L.length=0; cout<<"输入链表长度:"<<endl; cin>>n;
2017-11-22 19:52:44 226
原创 堆排序
#include #include #include using namespace std; typedef struct { int *r; int length; }sqlist; void createlink(sqlist &L) { int n; L.length=0; cout<<"输入链表长度:"<<endl; cin>>n;
2017-11-22 19:36:25 197
原创 循环链表应用之约瑟夫环
#include #include #include using namespace std; typedef struct node { char data; struct node *next; }slink,*ad; ad createlink(slink *head) { slink *p,*s; int n; cout<<"输入链表长度:"<<en
2017-11-15 17:29:14 283
原创 循环链表
#include #include #include using namespace std; typedef struct node { int data; struct node *next; }slink,*ad; ad createlink(slink *head) { slink *p,*s; int n; cout<<"输入链表长度:"<<end
2017-11-12 20:56:00 132
原创 运算符重载简单应用之分数四则运算
#include #include using namespace std; class fraction { double molecular,denominator; public: void start() { char ch; cout<<"输入分数:"<<endl; cin>>molecular;
2017-11-12 15:39:23 324
原创 字符串搜索函数应用
字符串对比: 题目说起来很简单,你会读到两个字符串,每个字符串占据一行,每个字符串的长度均小于10000字符,而且第一个字符串的长度小于第二个字符串的。你的程序要找出第一个字符串在第二个字符串中出现的位置,输出这些位置,如果找不到,则输出-1。 注意,第一个字符的位置是0。 注意,第一个字符串在第二个字符串中的位置可能不止一处。
2017-11-12 15:22:45 211
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人