各种排序方式的使用

一、排序的简单介绍

排序算法的稳定性:稳定性是指能保证排序前2个相等的数其在序列的前后位置顺序和排序后它们两个的前后位置顺序相同。例如,a1、a2的值相等,排序前 a1在a2位置前,排序后a1还是在a2位置前,则算法稳定。

下面举例时,都按从小到大排序。

(1)直接插入排序  (Straight Insertion Sort)

时间复杂度 O(n^2)  空间复杂度 O(1)  稳定

将要排序的元素放入结构体数组tmp[0...n-1]中,排序过程中,数组被分为子区间tmp[0...i-1]和tmp[i...n-1],其中前一个子区间是有序区;后一个子区间是无序区,i每加1时,要求tmp[i]插入到tmp[0...i-1]中适当的位置上,tmp[0...i]变为有序区。

原始序列 4 7 3 9 6第一步(4) (7 3 9 6)//第一个括号中序列为有序,第二个括号中无序第二步(4 7) (3 9 6)//取无序区中第一个元素7,for循环有序区,查找合适的位置插入(此处可用二分查找优化)第三步(3 4 7)(9 6)//取无序区中第一个元素3,for循环有序区,查找合适的位置插入第四步(3 4 7 9)(6)//取无序区中第一个元素9,同上第五步(3 4 6 7 9)排序完成

(2)希尔排序(Shell's Sort)

时间复杂度 O(nlog_{2}) 空间复杂度 O(1)  不稳定

先取一个小于n的整数d1作为第一个增量,把文件的全部记录分组。所有距离为d1的倍数的记录放在同一个组中。先在各组内进行直接插入排序;然后,取第二个增量d2<d1重复上述的分组和排序(一般d2=d1/2),直至所取的增量  =1(  <  …<d2<d1),即所有记录放在同一组中进行直接插入排序为止。

下列图片中:

(3)冒泡排序
时间复杂度 O(n^2) 空间复杂度 O(1) 稳定

在tmp[0...n]中,通过无序区相邻元素间的交换,使得无序区的最大元素下沉至有序区。第一次排序中无序区的最大元素到达位置tmp[n-1]的位置,下一次排序中,tmp[n-2]的位置上会填入tmp[0...n-2]中的最大元素,以此类推,知道i=n-1时程序截止。

原始序列 4 7 3 9 6
第一趟排序 4 3 7 6 9 //4比7小,故不交换位置。7比3大,则交换位置(4 3 7 9 6)。7比9小,故不交换位置。9比6大,则交换位置(4 3 7 6 9)。
第二趟排序 3 4 6 7 9 //4比3大,则交换位置(3 4 7 9 6)。4比7小,故不交换位置。7比6大,则交换位置(3 4 6 7 9)。
第三趟排序3 4 6 7 9 //3比4小,则交换位置。4比6小,则交换位置。
第四趟排序3 4 6 7 9  //3比4小,则交换位置。第五趟排序3 4 6 7 9  //排序完成

(4)快速排序(Quick Sort)

时间复杂度 O(nlog_{2}) 空间复杂度 O(nlog_{2})  不稳定

排序开始时,将第一个元素作为关键字,大于关键字的数字放在关键字后,小于关键字的数字放在关键字前(无序),则关键字归位,这种算法是以递归的方式写出来的。每次在排列完当前长度数组的关键字后,分别排列他的左区间和右区间,直到每个子区间内只剩一个关键字为止。

有一点需要注意

例如 6 2 7 3 8 9

第一趟排序以后是3 2 7 6 8 9 并不是 2 3 6 7 8 9,这是由算法的代码决定的。在学习时,建议看着代码自己手动模拟一遍。可以看百度百科中的排列演示

(5)直接选择排序

时间复杂度 O(n^2) 空间复杂度 O(1)  不稳定

排序开始时,有数组tmp[0...n-1],其基本思想:第一次从R[0]~R[n-1]中选取最小值,与R[0]交换,第二次从R[1]~R[n-1]中选取最小值,与R[1]交换,....,第i次从R[i-1]~R[n-1]中选取最小值,与R[i-1]交换,.....,第n-1次从R[n-2]~R[n-1]中选取最小值,与R[n-2]交换, 总共通过n-1次,得到一个按排序码从小到大排列的有序序列·

下标

0

1

2

3

4

原始序列

4

7

3

9

6

第一趟排序

在待排序列式(4 7 3 9 6)中最小的是3,3与小标为0的元素交换,待排序列式(4 7 9 6)

下标

0

1

2

3

4

原始序列

3

7

4

9

6

第二趟排序

在待排序列式(4 7 9 6)中最小的是4,4与小标为1的元素交换,待排序列式(7 9 6)

下标

0

1

2

3

4

原始序列

3

4

7

9

6

第三趟排序

在待排序列式(7 9 6)中最小的是6,6与小标为2的元素交换,待排序列式(9 7)

下标

0

1

2

3

4

原始序列

3

4

6

9

7

第四趟排序

在待排序列式(9 7)中最小的是7,7与小标为3的元素交换,待排序列式(9)

下标

0

1

2

3

4

原始序列

3

4

6

7

9

第五趟排序

排序完成

下标

0

1

2

3

4

原始序列

3

4

6

7

9

(6)堆排序

时间复杂度 O(nlog_{2}) 空间复杂度 O(nlog_{2})  不稳定

堆分为大根堆和小根堆。

大根堆的要求是每个节点的值都不大于其父节点的值,即A[PARENT[i]] >= A[i]。

小根堆的要求是任一非终端节点的值均不大于其左子节点和右子节点的值,即A[PARENT[i]] <= A[i]。

用大根堆排序的基本思想,先将初始文件R[1..n]建成一个大根堆,此堆为初始的无序区,再将关键字最大的记录R[1](即堆顶)和无序区的最后一个记录R[n]交换,由此得到新的无序区R[1..n-1]和有序区R[n],且满足R[1..n-1].keys≤R[n].key,由于交换后新的根R[1]可能违反堆性质,故应将当前无序区 R[1..n-1]调整为堆。然后再次将R[1..n-1]中关键字最大的记录R[1]和该区间的最后一个记录R[n-1]交换,由此得到新的无序区 R[1..n-2]和有序区R[n-1..n],且仍满足关系R[1..n-2].keys≤R[n-1..n].keys,同样要将R[1..n-2] 调整为堆。……直到无序区只有一个元素为止。

(7)归并排序

时间复杂度 O(nlog_{2}) 空间复杂度 O(nlog_{2})  稳定

归并排序是分治法思想运用的一个典范。将已有序的子序列合并,得到完全有序的序列;即先使每个子序列有序,再使子序列段间有序。若将两个有序表合并成一个有序表,称为二路归并。其主要算法操作:首先,将n个元素分成两个含n/2元素的子序列,然后用归并排序将两个子序列递归排序(最后可以将整个原序列分解成n个子序列),最后合并两个已排序好的序列。

原始序列 4   3   7   9   6 
排列下划线的数字
第一趟排序 3   4   7   9   6

第二趟排序 3  4  6  7  9

(8)二叉排序树

时间复杂度 O(nlog_{2}) 空间复杂度 O(n)  稳定

二叉排序树具有下列性质:(1)若左子树不空,则左子树上所有结点的值均小于它的根结点的值;(2)若右子树不空,则右子树上所有结点的值均大于它的根结点的值;(3)左、右子树也分别为二叉排序树;(4)没有键值相等的节点。查找基本原理:若根结点的关键字值等于查找的关键字,成功。否则,若小于根结点的关键字值,递归查左子树。若大于根结点的关键字值,递归查右子树。若子树为空,查找不成功。

二、文件打开方式

fopen,fclose

TXT文件的打开方式。待排序的内容在user.txt。user.txt中存放了120万余条用户编号(user_id)、密码(password)的记录。每行一条记录,user_id和password中间为TAB分隔(即C语言中的\t)。user_id的范围为:1~1,230,000

三、代码

#include <map>
#include <ctime>
#include <cstdio>
#include <cstring>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;typedef struct node
{char pass[15];int count;
}Node;//这个是用于(2)里面对密码的排序struct no {int num;char pw[15];struct no *next;
};//用于给(3)存储user_id
struct no *Crea();
struct no *Insert(struct no *head, struct no *p);
void Des(struct no *head);
void Print(struct no *head);
void find(struct no *head);
//以上为(3)用到的函数,提前声明先
typedef struct ser
{int user_num;char pw[15];struct ser *lchild,*rchild;
}*User;//这个是用于(4)里面的二叉排序树的struct ppp
{int id;char pw[15];
}user_ID[1230000];void quick_sort(Node s[], int l, int r)
{if (l < r){int i = l, j = r;Node x = s[l];while (i < j){while(i < j && s[j].count < x.count) j--;if(i < j)s[i++] = s[j];while(i < j && s[i].count > x.count) i++;if(i < j)s[j--] = s[i];}//退出whiles[i] = x;quick_sort(s, l, i - 1); quick_sort(s, i + 1, r);}
}void sift(Node r[], int low, int high)
{int i = low;int j = 2 * i;Node temp = r[i];while(j <= high){if(j < high && r[j].count > r[j + 1].count){j++;}if(temp.count > r[j].count){r[i] = r[j];i = j;j = 2 * i;}else break;}r[i] = temp;
}//将有二个有序数列a[first...mid]和a[mid...last]合并。
void mergearray(Node a[], int first, int mid, int last, Node temp[])
{int i = first, j = mid + 1;int m = mid,   n = last;int k = 0;while (i <= m && j <= n){if (a[i].count > a[j].count)temp[k++] = a[i++];elsetemp[k++] = a[j++];}while (i <= m)temp[k++] = a[i++];while (j <= n)temp[k++] = a[j++];for (i = 0; i < k; i++)a[first + i] = temp[i];
}
void mergesort(Node a[], int first, int last, Node temp[])
{if (first < last){int mid = (first + last) / 2;mergesort(a, first, mid, temp);    //使左边有序mergesort(a, mid + 1, last, temp); //使右边有序mergearray(a, first, mid, last, temp); //再将二个有序数列合并}
}void beginsort()
{FILE *fp;//已检验password共有37318不同的数据clock_t start;Node tem[38000];Node tmp[38000];if((fp=fopen("D:\\A_Code_Mokey\\password.txt","r"))==NULL){printf("Please make sure the input file exist\n");//如果不存在输出提示exit(0);}int k = 0;while(fscanf(fp,"%s\t%d\n",tem[k].pass,&tem[k].count)!=EOF){tmp[k] = tem[k];k++;}fclose(fp);//关闭文件password.txt//开始直接插入排序int j;start = clock();//初始化时间for(int i = 1; i < k; i++){if(tmp[i].count > tmp[i-1].count){Node temp = tmp[i];for(j = i-1; j>=0 && tmp[j].count<temp.count; j--){tmp[j+1] = tmp[j];}tmp[j+1] = temp;}}printf("The cost time of straight insertion sort(zhi jie cha ru sort):\n%ldms\n",clock()-start);//直接插入插入排序结束if((fp=fopen("D:\\A_Code_Mokey\\straight_insertion_sort.txt","w"))==NULL) //判断文件是否存在,fp指向straight_insertion_sort.txt{fp=fopen("D:\\A_Code_Mokey\\straight_insertion_sort.txt","w"); //如果文件不存在,新建一个文件}for(int i = 0; i < k; i++){fprintf(fp,"%d\t%s\n",tmp[i].count,tmp[i].pass);}fclose(fp);//开始希尔排序for(int i = 0; i < k; i++){tmp[i] = tem[i];//初始化tmp数组}start = clock();//初始化时间for (int gap = k>>1; gap > 0; gap >>= 1)//开始希尔排序{for (int i = gap; i < k; i++) {Node temp = tmp[i];for (j = i-gap; j >= 0 && tmp[j].count < temp.count; j -= gap){tmp[j + gap] = tmp[j];}tmp[j + gap] = temp;}}printf("The cost time of shell_sort(xi er sort):\n%ldms\n",clock()-start);//希尔排序结束if((fp=fopen("D:\\A_Code_Mokey\\shell_sort.txt","w"))==NULL) //判断文件是否存在,fp指向shell_sort{fp=fopen("D:\\A_Code_Mokey\\shell_sort.txt","w"); //如果文件不存在,新建一个文件}for(int i = 0; i < k; i++){fprintf(fp,"%d\t%s\n",tmp[i].count,tmp[i].pass);}fclose(fp);//开始冒泡排序for(int i = 0; i < k; i++){tmp[i] = tem[i];//初始化tmp数组}start = clock();//初始化时间for(int i = 0; i < k; i++)//开始冒泡排序{for(j = i; j < k; j ++){if(tmp[i].count < tmp[j].count){Node temp = tmp[i];tmp[i] = tmp[j];tmp[j] = temp;}}}printf("The cost time of bubble sort(mao pao sort):\n%ldms\n",clock()-start);//冒泡插入排序结束if((fp=fopen("D:\\A_Code_Mokey\\bubble_sort.txt","w"))==NULL) //判断文件是否存在,fp指向shell_sort{fp=fopen("D:\\A_Code_Mokey\\bubble_sort.txt","w"); //如果文件不存在,新建一个文件}for(int i = 0; i < k; i++){fprintf(fp,"%d\t%s\n",tmp[i].count,tmp[i].pass);}//开始快速排序for(int i = 0; i < k; i++){tmp[i] = tem[i];//初始化tmp数组}start = clock();//初始化时间quick_sort(tmp,0,k-1);printf("The cost time of quick sort(kuai su sort):\n%ldms\n",clock()-start);//快速排序结束if((fp=fopen("D:\\A_Code_Mokey\\quick_sort.txt","w"))==NULL) //判断文件是否存在,fp指向shell_sort{fp=fopen("D:\\A_Code_Mokey\\quick_sort.txt","w"); //如果文件不存在,新建一个文件}for(int i = 0; i < k; i++){fprintf(fp,"%d\t%s\n",tmp[i].count,tmp[i].pass);}fclose(fp);//开始直接选择排序for(int i = 0; i < k; i++){tmp[i] = tem[i];//初始化tmp数组}start = clock();//初始化时间for(int i = 0; i < k - 1; i++)//开始直接选择排序{int x = i;for(int j = i + 1; j < k; j++){if (tmp[j].count > tmp[x].count){x = j;}}if(x != i){Node temp = tmp[i];tmp[i] = tmp[x];tmp[x] = temp;}}printf("The cost time of straight select sort(zhi jie xuan ze sort):\n%ldms\n", clock()-start);//直接选择排序结束if((fp=fopen("D:\\A_Code_Mokey\\straight_select_sort.txt","w"))==NULL) //判断文件是否存在,fp指向shell_sort{fp=fopen("D:\\A_Code_Mokey\\straight_select_sort.txt","w"); //如果文件不存在,新建一个文件}for(int i = 0; i < k; i++){fprintf(fp,"%d\t%s\n",tmp[i].count,tmp[i].pass);}fclose(fp);//开始堆排序for(int i = 0; i < k; i++){tmp[i] = tem[i];//初始化tmp数组}start = clock();//初始化时间for(int i = k / 2; i >= 1; i--)//开始堆排序{sift(tmp, i, k);}for(int i = k; i >= 2; i--){Node temp = tmp[1];tmp[1] = tmp[i];tmp[i] = temp;sift(tmp, 1, i - 1);}printf("The cost time of sift sort(dui sort):\n%ldms\n", clock()-start);//堆排序结束if((fp=fopen("D:\\A_Code_Mokey\\sift_sort.txt","w"))==NULL) //判断文件是否存在,fp指向shell_sort{fp=fopen("D:\\A_Code_Mokey\\sift_sort.txt","w"); //如果文件不存在,新建一个文件}for(int i = 1; i <= k; i++){fprintf(fp,"%d\t%s\n",tmp[i].count,tmp[i].pass);}fclose(fp);//开始归并排序for(int i = 0; i < k; i++){tmp[i] = tem[i];//初始化tmp数组}start = clock();//初始化时间Node *p = new Node[k];mergesort(tmp,0,k-1,p);printf("The cost time of merge sort (gui bing sort):\n%ldms\n",clock()-start);//归并排序结束if((fp=fopen("D:\\A_Code_Mokey\\merge_sort.txt","w"))==NULL) //判断文件是否存在,fp指向shell_sort{fp=fopen("D:\\A_Code_Mokey\\merge_sort.txt","w"); //如果文件不存在,新建一个文件}int count20 = 0;printf("The top twenty most used passwords and frequency:\n");for(int i = 0; i < k; i++){if(count20 < 20){count20++;printf("%s\t%d\n",tmp[i].pass,tmp[i].count);}fprintf(fp,"%d\t%s\n",tmp[i].count,tmp[i].pass);}fclose(fp);delete[] p;
}void insertBST(User &root, int key,char tt[])
{User f,p = root;f = p;while(p){f = p;if(p->user_num < key)p = p->rchild;else p = p->lchild;}p = (struct ser*)malloc(sizeof(ser));p->user_num = key;p->lchild = p->rchild = NULL;//strcpy(p->pw,tt);if(f == NULL)root = p;else if(f->user_num < key)f->rchild = p;else f->lchild = p;
}bool SearchBST(User root,int key)
{while(root){if(key == root->user_num)return true;else if(key > root->user_num)root = root->rchild;else root = root->lchild;}return false;
}void deleteBST(User root)
{if(root){deleteBST(root->lchild);    //释放左子树deleteBST(root->rchild);    //释放右子树free(root);        //释放根结点}
}void binary_sort_tree(int k)//k是有多少个user_ID
{clock_t start,mid,end;User root;root = NULL;for(int i = 0; i < k; i++)insertBST(root,user_ID[i].id,user_ID[i].pw);//开始生成随机的2200的idint randint[2030];srand(unsigned(time(0)));for(int i = 0; i < 2000; i++){int tmp = rand();randint[i] = (tmp*40+rand())%1230000;}for(int i = 2000; i < 2020; i++){int tmp = rand();randint[i] = (tmp*40+rand())%1230000 + 1230000;}//将产生的随机函数存入randint;start = clock();for(int i = 0; i < 2000; i++){SearchBST(root,randint[i]);/*if(SearchBST(root,randint[i]))printf("1");else printf("0\n");*///可以用来测试是否查找到了}mid = clock();for(int i = 2000; i < 2020; i++){SearchBST(root,randint[i]);}end = clock();printf("The cost of binary_sort_tree to find 2000 userids(1~1230000)is:\n%ldms\n",mid-start);printf("The cost of binary_sort_tree to find 20 userids(bigger than 1230000)is:\n%ldms\n",end-mid);printf("The cost of binary_sort_tree to find 2020 userids is:\n%ldms\n",end-start);deleteBST(root);
}int halfsearch(int k,int tmp)
{int mid,low,high;low = 0;high = k-1;mid = (low+high)>>1;while(low <= high){mid = (low+high)>>1;if(user_ID[mid].id == tmp)return 1;else if(user_ID[mid].id > tmp)high = mid-1;else low = mid+1;}return 0;
}bool cmp(struct ppp a,struct ppp b)
{if(a.id > b.id)return true;return false;
}void half_interval_search(int k)
{FILE *fp;clock_t start,mid,end;int flag;if((fp=fopen("D:\\A_Code_Mokey\\user_sorted.txt","w"))==NULL){fp=fopen("D:\\A_Code_Mokey\\user_sorted.txt","w");}sort(user_ID,user_ID+k,cmp);for(int i = 0; i < k; i++){fprintf(fp,"%d\t%s\n",user_ID[i].id,user_ID[i].pw);//写入文件user_sorted。txt}fclose(fp);//开始生成随机的2200的idint randint[2030];srand(unsigned(time(0)));for(int i = 0; i < 2000; i++){int tmp = rand();randint[i] = (tmp*40+rand())%1230000;}for(int i = 2000; i < 2020; i++){int tmp = rand();randint[i] = (tmp*40+rand())%1230000 + 1230000;}//将产生的随机函数存入randintstart = clock();for(int i = 0; i < 2000; i++){flag = halfsearch(k,randint[i]);/*if(halfsearch(k,randint[i]))printf("1");else printf("0\n");//可以用来测试是否查找到了*/}mid = clock();for(int i = 2000; i < 2020; i++){flag = halfsearch(k,randint[i]);/*if(halfsearch(k,randint[i]))printf("1");else printf("0\n");*/}end = clock();printf("The cost of half_interval_search to find 2000 userids(1~1230000)is:\n%ldms\n",mid-start);printf("The cost of half_interval_search to find 20 userids(bigger than 1230000)is:\n%ldms\n",end-mid);printf("The cost of half_interval_search to find 2020 userids is:\n%ldms\n",end-start);
}void read()
{struct no *head, *p;head = Crea();find(head);Des(head);
}struct no *Crea()
{FILE *fp1;struct no *head, *p;int num;char pass[15];head = NULL;if((fp1 = fopen("D:\\A_Code_Mokey\\user.txt", "r")) == NULL){printf("NO OPEN!!!\n");exit(0);}while(fscanf(fp1, "%d\t%s\n", &num, pass) != EOF){p = (struct no*)malloc(sizeof(struct no));strcpy(p->pw,pass);p->num = num;head = Insert(head, p);}fclose(fp1);return head;
}struct no *Insert(struct no *head, struct no *p)
{struct no *ptr, *ptr1, *ptr2;ptr2 = head;ptr = p;if(head == NULL){head = ptr;head->next = NULL;}else{head = ptr;ptr->next = ptr2;}return head;
}void Des(struct no *head)
{struct no *p, *ptr;ptr = head;p = head->next;while(p != NULL){free(ptr);ptr = p;p = p->next;}free(ptr);
}void find(struct no *head)
{struct no *ptr;//开始生成随机的2200的idint randint[2030];srand(unsigned(time(0)));for(int i = 0; i < 2000; i++){int tmp = rand();randint[i] = (tmp*40+rand())%1230000;}for(int i = 2000; i < 2020; i++){int tmp = rand();randint[i] = (tmp*40+rand())%1230000 + 1230000;}//将产生的随机函数存入randintclock_t start, mid, end;if(head == NULL){printf("List is NULL! ! !\n");return;}start = clock();for(int i = 0; i < 2000; i++){for(ptr = head; ptr != NULL;ptr = ptr->next){if(ptr->num == randint[i]){break;}}}mid = clock();printf("The cost of link_list to find 2000 userids(1~1230000)is: \n%dms\n",mid-start);for(int i = 2000; i < 2020; i++){for(ptr = head; ptr != NULL;ptr = ptr->next){if(ptr->num == randint[i]){break;}}}end = clock();printf("The cost of link_list to find 20 userids(bigger than 1230000)is: \n%dms\n", end-mid);printf("The cost of lind_list to find 2020 userids is:\n%dms\n",end-start);
}int main()
{int hehe,k;char user_Pass[15];FILE *fp1,*fp2;printf("Welcome to the home of A_Code_Mokey\nPlease enter the number 520\n");// 请忽视while(scanf("%d",&hehe)){map<string,int> pass;pass.clear();if((fp1=fopen("D:\\A_Code_Mokey\\user.txt","r"))==NULL) //判断文件是否存在,fp1指向user.txt{printf("Please make sure the input file exist\n");//如果不存在输出提示exit(0);}if((fp2=fopen("D:\\A_Code_Mokey\\password.txt","w"))==NULL) //判断文件是否存在,fp2指向passord.txt{fp2=fopen("D:\\A_Code_Mokey\\password.txt","w"); //如果文件不存在,新建一个文件}k = 0;while (fscanf(fp1,"%d\t%s\n",&user_ID[k].id,user_Pass)!=EOF)//从文件读入usr_ID password{strcpy(user_ID[k].pw,user_Pass);string user_Password(user_Pass);//强制类型转化,char 转化为 string,因为使用map<char*,int>会出现错误pass[user_Password]++;k++;//将user_id全部存入数组user-ID中}fclose(fp1); //关闭文件user.txtfclose(fp1); //关闭文件password.txtmap<string,int>::iterator iter;for(iter = pass.begin(); iter != pass.end(); iter++)//把统计密码的结果写入password.txt{string user_Password = iter->first;const int len = user_Password.length();char* user_Pass=new char [len+1];strcpy(user_Pass,user_Password.c_str());  //制类型转化,string 转化为 charfprintf(fp2, "%s\t%d\n", user_Pass,iter->second);//写入password.txt.delete[] user_Pass;}/*到现在为止已经完成 (1)统计密码出现次数*/beginsort();//让这个来完成(2)神圣的排序,嗯,就是这样        read();//链表存放查找(3)binary_sort_tree(k);//二叉排序查找(4),k是有多少个user_IDhalf_interval_search(k);//二分查找(5),k是有多少个user_IDprintf("GAME OVER\n");}return 0;
}
Shell's Sort
别    名
缩小 增量排序
类    型
插入排序
时间复杂度
O(n^1.3)
空间复杂度
O(1)
Shell's Sort

课程设计-多种排序方式相关推荐

  1. c语言大作业成绩分析问题,河南科技大学c语言课程设计-综合排序设计报告-成绩分析问题.doc...

    河南科技大学c语言课程设计-综合排序设计报告-成绩分析问题.doc 河南科技大学综合程序设计报告成绩分析问题学院电气工程学院年级专业电子161学号161404110104学生姓名李恺指导教师赵老师1. ...

  2. 视频营销:一款产品如何设计多种赚钱方式

    每个视频,都是你的金牌业务员 这是我写的第40篇视频营销原创文章 与其搜索十年,不如花一年的时间学习,去赚9年的高薪! 大多数人只是在卖产品的本身, 其实任何一款产品都可以设计出多种不同的赚钱方式: ...

  3. 数据结构课程设计之排序综合

    题目: 实现功能: 利用随机函数产生N个随机整数(20000以上),对这些数进行多种方法进行排序. 要求: 1) 至少采用三种方法实现上述问题求解(提示,可采用的方法有插入排序.希尔排序.起泡排序.快 ...

  4. 课程设计:混合数据排序

    一.题目:混合数据排序 二.目的与要求 1. 目的: (1)通过该题目的设计,培养学生综合利用C++语言解决问题的能力,使学生理解和掌握C++中组的应用及 排序算法,将所学知识转化为分析和设计简单实际 ...

  5. 课程设计:大学生信息管理系统

    一.题目:17大学生信息管理系统 二.目的与要求 1. 目的 培养学生综合利用C++语言进行程序设计的能力,培养学生的编程能力.用计算机解决实际问题的能力,加强对理论知识的理解和实际运用:培养学生对软 ...

  6. python读取文件并且排序_python 顺序读取文件夹下面的文件(自定义排序方式)...

    我们在读取文件夹下面的文件时,有时是希望能够按照相应的顺序来读取,但是 file_lists=os.listdir()返回的文件名不一定是顺序的,也就是说结果是不固定的.就比如读取下面这些文件,希望能 ...

  7. 一篇文章带你看懂以及实现加解密技术中的信息防篡改、一码一检、过期失效、多种实现方式

    一篇文章带你看懂以及实现加解密技术中的信息防篡改.一码一检.过期失效.多实现方式 导语 一.简介 二.代码功能介绍以及源码 2.1.AbstractRsa 类 2.2 RsaUtils 类 2.3 R ...

  8. python基于svm项目+课程设计报告_单片机课程设计教学模式研究

    单片机课程设计教学模式研究 摘要:在分析单片机课程设计现状的基础上,提出将先进的CDIO工程教育理念应用到单片机课程设计教学中,对课程设计的时间安排.选题.组织实施.考核等方面进行改革与创新,构建新的 ...

  9. 《数据结构》课程设计-排序算法可视化

    <数据结构>课程设计-js实现排序算法可视化 先上效果图: 一.数据可视化 1.什么是数据可视化 数据可视化主要旨在借助于图形化手段,清晰有效地传达与沟通信息.但是,这并不就意味着数据可视 ...

最新文章

  1. 有关XSS编码问题的个人总结
  2. 在layui中使用 jquery 触发select 的 change事件无效
  3. Java中的Enum的使用与分析
  4. 判断 CGRect是否“为空”
  5. 论文浅尝 | LGESQL: 结合线性有向图以及普通有向图的自然语言转换SQL语句模型...
  6. JUnit4常用的注解
  7. python输出一棵松树_松树程序间距
  8. iOS开发中的单元测试(三)——URLManager中的测试用例解析
  9. 【干货】前端单元测试入门
  10. 优必选发布新一代大型机器人Walker X
  11. TensorFlow saved_model 模块
  12. Mybatis 查询出来的数据数量正确,但是具体数据为null
  13. Access2016学习6
  14. WELCOME TO `ICE WORLD`
  15. 金蝶KIS保存记账凭证的时候提示“在清除未下设辅助账的科目所在的会计分录中的核算项目代码时出现冲突或错误,凭证还没有被保存,请您稍后重试。”错误
  16. JVM简笔—类的加载
  17. android手机整体规模,2021年Android手机市场规模
  18. Labview文字识别-从训练到识别
  19. Linux改变图片大小的命令,如何在Ubuntu命令行上调整图像大小
  20. ESModule 系列 :构建下一代基础设施 PDN

热门文章

  1. 随笔荟萃 | sincerity
  2. 第七诫:不可不关注生活和亲近大自然
  3. 3DMax切割、拆分(分离模型)
  4. 航班系统C语言程序流程图,飞机订票系统(C语言代码及流程图)
  5. React支持IE9/10/11
  6. 2020年1月中国编程语言排行榜,python是2019增长最快编程语言
  7. 加一计时器——每隔1s六位数码管显示数字加1,直至999999,之后归零,重新开始。
  8. c语言中加减乘除英文,英语语法基础知识:英语加减乘除运算的表示方法
  9. 2014一个萝卜一个“坑”
  10. C++解题报告:详解经典搜索难题——八数码问题( 双向BFS A* 求解)