文件名称:exchange
-
所属分类:
- 标签属性:
- 上传时间:2013-04-19
-
文件大小:774byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
交换排序:
包括冒泡排序,快速排序。
冒泡排序法:该算法是专门针对已部分排序的数据进行排序的一种排序算法。如果在你的数据清单中只有一两个数据是乱序的话,用这种算法就是最快的排序算法。如果你的数据清单中的数据是随机排列的,那么这种方法就成了最慢的算法了。因此在使用这种算法之前一定要慎重。这种算法的核心思想是扫描数据清单,寻找出现乱序的两个相邻的项目。当找到这两个项目后,交换项目的位置然后继续扫描。重复上面的操作直到所有的项目都按顺序排好。
快速排序:通过一趟排序,将待排序记录分割成独立的两个部分,其中一部分记录的关键字均比另一部分记录的关键字小,则可分别对这两部分记录继续进行排序,以达到整个序列有序。具体做法是:使用两个指针low,high, 初值分别设置为序列的头,和序列的尾,设置pivotkey为第一个记录,首先从high开始向前搜索第一个小于pivotkey的记录和pivotkey所在位置进行交换,然后从low开始向后搜索第一个大于pivotkey的记录和此时pivotkey所在位置进行交换,重复知道low=high了为止。-Exchange Sort:
Including bubble sort, quick sort.
Bubble sort method: the algorithm has been partially sorted data sort of a sorting algorithm. If only one or two of data in your data list is out of order, this algorithm is the fastest sorting algorithm. If the data in your data list is randomly arranged, then this method has become the slowest algorithm. Before using this algorithm must be careful. The core idea of this algorithm is a list of scan data, looking for out-of-order two adjacent items. When you find these two projects, the location of the exchange program and continue scanning. Repeat the above operation until all items are arranged in order.
Quick Sort: Sort by trip will be sorted record is divided into two separate parts, a part of the record of keyword key is smaller than the other part of the record, you can continue to sort the two part of the record in order to achieve The entire sequence is ordered. Specific approach is: use two pointers low, high, and the
包括冒泡排序,快速排序。
冒泡排序法:该算法是专门针对已部分排序的数据进行排序的一种排序算法。如果在你的数据清单中只有一两个数据是乱序的话,用这种算法就是最快的排序算法。如果你的数据清单中的数据是随机排列的,那么这种方法就成了最慢的算法了。因此在使用这种算法之前一定要慎重。这种算法的核心思想是扫描数据清单,寻找出现乱序的两个相邻的项目。当找到这两个项目后,交换项目的位置然后继续扫描。重复上面的操作直到所有的项目都按顺序排好。
快速排序:通过一趟排序,将待排序记录分割成独立的两个部分,其中一部分记录的关键字均比另一部分记录的关键字小,则可分别对这两部分记录继续进行排序,以达到整个序列有序。具体做法是:使用两个指针low,high, 初值分别设置为序列的头,和序列的尾,设置pivotkey为第一个记录,首先从high开始向前搜索第一个小于pivotkey的记录和pivotkey所在位置进行交换,然后从low开始向后搜索第一个大于pivotkey的记录和此时pivotkey所在位置进行交换,重复知道low=high了为止。-Exchange Sort:
Including bubble sort, quick sort.
Bubble sort method: the algorithm has been partially sorted data sort of a sorting algorithm. If only one or two of data in your data list is out of order, this algorithm is the fastest sorting algorithm. If the data in your data list is randomly arranged, then this method has become the slowest algorithm. Before using this algorithm must be careful. The core idea of this algorithm is a list of scan data, looking for out-of-order two adjacent items. When you find these two projects, the location of the exchange program and continue scanning. Repeat the above operation until all items are arranged in order.
Quick Sort: Sort by trip will be sorted record is divided into two separate parts, a part of the record of keyword key is smaller than the other part of the record, you can continue to sort the two part of the record in order to achieve The entire sequence is ordered. Specific approach is: use two pointers low, high, and the
(系统自动生成,下载前可以参看下载内容)
下载文件列表
exchange.java
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.