随笔分类 -  C++算法

c++-排序算法-选择排序
摘要:1 #include <iostream> 2 3 using namespace std; 4 5 //选择排序 6 void selectSort(int arr[], int length) 7 { 8 for (int i = 0; i < length - 2; i++) 9 { 10 i 阅读全文

posted @ 2021-10-02 20:05 imbaby 阅读(129) 评论(0) 推荐(0)

c++-排序算法-冒泡排序
摘要:1 #include <iostream> 2 3 using namespace std; 4 5 //冒泡排序 6 //对数组进行从小到大排序 7 void bubbleSort(int arr[], int length) 8 { 9 for (int i = length - 1; i >= 阅读全文

posted @ 2021-08-14 11:01 imbaby 阅读(73) 评论(0) 推荐(0)