摘要:
最简单的排序方式,实现如下:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--///<summary>///冒泡排序///</summary>///<paramname="data"></param>p... 阅读全文
摘要:
选择排序法核心思想是:每一趟排序选择未排序元素中最小元素作为已排序部分的一个新元素。具体实现如下:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--///<summary>///选择排序///</summary>///<... 阅读全文
摘要:
快速排序是对冒泡排序的一种改进。它基于分治策略,对于要排序的一个序列,从中选一值进行排序,将其放入到正确的位置position。然后以position为界,对左右两部分再分别做排序。直到划分的长度为1。具体实现如下:代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighte... 阅读全文