文件名称:insert

  • 所属分类:
  • 其他小程序
  • 资源属性:
  • [Java] [源码]
  • 上传时间:
  • 2013-04-19
  • 文件大小:
  • 1kb
  • 下载次数:
  • 0次
  • 提 供 者:
  • 陈*
  • 相关连接:
  • 下载说明:
  • 别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容均来自于网络,请自行研究使用

插入排序:



包括直接插入排序,希尔插入排序。



直接插入排序: 将一个记录插入到已经排序好的有序表中。



1, sorted数组的第0个位置没有放数据。



2,从sorted第二个数据开始处理:



如果该数据比它前面的数据要小,说明该数据要往前面移动。



首先将该数据备份放到 sorted的第0位置当哨兵。



然后将该数据前面那个数据后移。



然后往前搜索,找插入位置。



找到插入位置之后讲 第0位置的那个数据插入对应位置。



O(n*n), 当待排记录序列为正序时,时间复杂度提高至O(n)。



希尔排序(缩小增量排序 diminishing increment sort):先将整个待排记录序列分割成若干个子序列分别进行直接插入排序,待整个序列中的记录基本有序时,再对全体记录进行一次直接插入排序。-Insertion Sort:



Including direct insertion sort, Hill insertion sort.



Direct insertion sort: a record inserted into the already sorted the good and orderly table.



   1 0th position in the sorted array is not the playback data.



   2, starting from the sorted data processing:



       If the data to be smaller than its preceding data, Descr iption the data to Wang Qianmian mobile.



       First backup the data sorted into the 0 position when the sentry.



       The data in front of the data after the shift.



       Then forward search to find the insertion position.



       Find the insertion position stresses that the 0 position data into the corresponding position.



O (n* n), to be ranked record a sequence of positive sequence, the time complexity up to O (n).



Hill sorting (narrow incremental sort of diminishing increment sort): to be ranked first copy the entire record sequence is divided into a number of sub-sequences,
(系统自动生成,下载前可以参看下载内容)

下载文件列表





insert.java

相关说明

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

相关评论

暂无评论内容.

发表评论

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

源码中国 www.ymcn.org