
排序算法
Storming2011
熟练掌握图形算法、PC桌面软件、三维显示及动画、大数据与并行运算,能独立高效的完成前后端完整开发任务,有多项自己的创新算法。
展开
-
排序
快速排序: 思想 快速排序采用的思想是分治思想。 快速排序是找出一个元素(理论上可以随便找一个)作为基准(pivot),然后对数组进行分区操作,使基准左边元素的值都不大于基准值,基准右边的元素值 都不小于基准值,如此作为基准的元素调整到排序后的正确位置。递归快速排序,将其他n-1个元素也调整到排序后的正确位置。最后每个元素都是在排序后的正 确位置,排序完成。所以快速排序算法的核心转载 2015-12-10 08:46:36 · 384 阅读 · 0 评论 -
排序算法之冒泡排序
// BubbleSort.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "iostream" using namespace std; // 说明:排序算法 void BubbleSort(double a[], int n) { for (int原创 2016-08-21 12:44:25 · 257 阅读 · 0 评论 -
排序算法之选择排序
// SelectSort.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "iostream" using namespace std; // 说明:排序算法 - 每一次迭代中都选择最小的数 void SelectSort(double a[], int原创 2016-08-21 15:34:33 · 357 阅读 · 0 评论 -
排序算法之插入排序(模板类)
#include using namespace std; template class element { public: element() { key = T(0);} ~element() {}; public: T key; }; class insert_sort { public: template void Sort(element list[原创 2016-08-15 21:53:05 · 395 阅读 · 0 评论 -
排序算法之归并排序(模板类)
#include using namespace std; template class element { public: element() { key = T(0);} ~element() {}; public: T key; }; #pragma once class merge_sort { public: merge_sort(void); ~m原创 2016-08-15 21:50:52 · 1012 阅读 · 0 评论 -
排序算法之直接插入排序
// InsertSort.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "iostream" using namespace std; // 说明:排序算法 - 插入排序,纸牌准则,将一个元素插入到已排序的序列中; void InsertSort(do原创 2016-08-21 16:07:05 · 231 阅读 · 0 评论 -
排序算法之希尔排序(传统排序的突破)
// ShellSort.cpp : Defines the entry point for the console application. // #include "stdafx.h" // SelectSort.cpp : Defines the entry point for the console application. #include "iostream" using name原创 2016-08-21 16:38:02 · 374 阅读 · 0 评论 -
排序算法之快速排序
// QuickSort.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "iostream" using namespace std; // 说明:排序算法 - 快速排序, 通过一趟排序将待排记录分割成独立的两部分,其中一部分记录的关键字比另一部分记录的原创 2016-08-21 17:38:06 · 295 阅读 · 0 评论 -
排序算法之归并排序
// MergeSort.cpp : Defines the entry point for the console application. // #include "stdafx.h" // SelectSort.cpp : Defines the entry point for the console application. // #include "iostream" using na原创 2016-08-21 20:49:38 · 244 阅读 · 0 评论