- 博客(10)
- 资源 (5)
- 收藏
- 关注
原创 数据结构实验之排序三:bucket sort
点击打开链接 #include #include using namespace std; int a[500]; int main() { int x,n; while(~scanf("%d",&n)) { memset(a,0,sizeof(a)); for(int i=0;i
2016-12-14 18:33:09
279
原创 数据结构实验之排序二:交换排序
点击打开链接 数据相等的时候不交换; 快排完成的数组不能再统计冒泡的次数 #include #include using namespace std; int a[1100000],b[1100000],num1,num2,n; void qsort(int a[110000],int l,int r) { int i = l,j = r; i
2016-12-14 18:31:59
354
原创 一趟快排
点击打开链接 A一趟快排 不继续调用本身进行左右排序 #include #include using namespace std; int a[1100000]; void qsort(int a[1100000],int l,int r) { int i = l,j = r; int x = a[l]; if(l>=r) retu
2016-12-14 18:31:10
301
原创 数据结构实验之排序三:bucket sort
点击打开链接 #include #include using namespace std; int a[500]; int main() { int x,n; while(~scanf("%d",&n)) { memset(a,0,sizeof(a)); for(int i=0;i {
2016-12-14 18:28:28
206
原创 约瑟夫问题
点击打开链接 #include #include #include struct node { int data; node *next; }; struct node *creat(int n) { node *p,*tail,*head; p= new node; p->next = NULL; p->data
2016-08-23 17:08:50
227
原创 数据结构实验之链表九:双向链表
点击打开链接 #include #include struct node { int data; struct node *next,*prior; }; struct node *creat_desq(int n); void search(struct node *head,int n); int main() { struct node
2016-08-23 17:07:17
227
原创 数据结构实验之链表三:链表的逆置
点击打开链接 #include #include struct node { int data; struct node * next; }; //顺序建立链表 struct node *creatw() { int a ; struct node *head,*p,*tail; head=(struct node
2016-08-23 16:25:17
243
原创 数据结构实验之链表七:单链表中重复元素的删除
点击打开链接 #include #include #include using namespace std; typedef int element; struct node { element data; node *next; }; element n; struct node *Creat(int n) { struct node *
2016-08-23 16:19:45
282
原创 有序链表的归并
点击打开链接 #include #include struct node { int data; struct node *next; }; //顺序创建链表 struct node *creatw(int n) { struct node *head,*tail,*p; int i; head = (struct no
2016-08-23 16:08:12
422
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅