文件名称:exchange

  • 所属分类:
  • 其他小程序
  • 资源属性:
  • [Java] [源码]
  • 上传时间:
  • 2013-04-19
  • 文件大小:
  • 1kb
  • 下载次数:
  • 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
(系统自动生成,下载前可以参看下载内容)

下载文件列表





exchange.java

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org