
排序
文章平均质量分 70
weixin_42173948
这个作者很懒,什么都没留下…
展开
-
荷兰国旗快排
#include "stdafx.h" #include <iostream> #include <string> #include <vector> using namespace std; /* 荷兰国旗快排 */ class Sort { public: int* Partition(int arr[], int L, int R) { int less = L - 1; int more = R; int cur = L; whil..原创 2020-07-13 16:23:47 · 184 阅读 · 0 评论 -
堆排序
#include "stdafx.h" #include <iostream> #include <string> #include <vector> using namespace std; /* 荷兰国旗快排 */ class Sort { public: int* Partition(int arr[], int L, int R) { int less = L - 1; int more = R; int cur = L; whil..原创 2020-07-13 17:33:37 · 96 阅读 · 0 评论 -
数据结构和排序
数据分为 逻辑结构: 集合、线性结构(一一)、树形结构(一多)和图状结构(多多); 物理结构 顺序存储结构 连续 链式存储结构 数据任意存储单元,通过保存地址方式找到关联数据元素 队列的定义 队列:一头压入,另一头弹出,先进先出 栈:只能栈顶插入和删除,先进后出 排序 选择、冒泡、插入 归并、快速、 ...原创 2020-07-06 16:16:19 · 191 阅读 · 0 评论 -
快速排序
#include <stdio.h> #include <stdlib.h> #include <string.h> void swap(int* a, int* b) { int tmp = 0; tmp = *a; *a = *b; *b = tmp; } void mergeAdd(int arr[], int left, int right) {//实现...原创 2020-04-19 12:50:41 · 527 阅读 · 0 评论 -
归并排序
#include <stdio.h> #include <stdlib.h> #include <string.h> void mergeAdd(int arr[], int left, int mid, int right, int* temp) {//实现“治” int i = left; int j = mid+1; int k = left; ...原创 2020-04-18 20:48:58 · 95 阅读 · 0 评论 -
选择、冒泡、插入排序
#include <stdio.h> #include <stdbool.h> void swap(int* a, int* b); void bubbleSort(int arr[], int ArrSize); void cockTailSort(int arr[], int ArrSize); void choiceSort(int arr[], int arrSi...原创 2020-04-18 10:49:19 · 97 阅读 · 0 评论