摘要: 1 //冒泡排序 2 #include<iostream> 3 #include <algorithm> 4 using namespace std; 5 void bubblesort(int a[], int size) 6 { 7 int i, j; 8 for (i = 0; i < siz 阅读全文
posted @ 2020-12-15 23:46 丁帅帅dss 阅读(69) 评论(0) 推荐(0)
摘要: 1 //选择排序 2 #include<iostream> 3 #include <algorithm> 4 using namespace std; 5 void selectsort(int a[], int size) 6 { 7 int pos, min, j; 8 for (pos=0;p 阅读全文
posted @ 2020-12-15 23:37 丁帅帅dss 阅读(53) 评论(0) 推荐(0)
摘要: 1 //希尔排序 2 #include <iostream> 3 #include <algorithm> 4 using namespace std; 5 void ShellSort(int a[], int n) 6 { 7 int gap, pos, j; 8 int tmp; 9 for 阅读全文
posted @ 2020-12-15 23:13 丁帅帅dss 阅读(58) 评论(0) 推荐(0)
摘要: 1 //堆排序 2 #include <iostream> 3 #include <algorithm> 4 using namespace std; 5 void duipai1(int a[], int pos, int size) 6 { 7 int child; 8 int tmp = a[ 阅读全文
posted @ 2020-12-15 22:51 丁帅帅dss 阅读(68) 评论(0) 推荐(0)