73

java插入排序-锦瑟无端五十弦-51CTO博客

 7 years ago
source link: http://blog.51cto.com/10972685/2071606
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
插入排序的思想就和玩扑克是的摸牌一样,摸到一张牌放手上,再摸一张和之前的比较,大的就放后面,小的就放前面。一个数列我们把它分为两个区,一个是已经排序的区,一个是乱序区,选取第一个元素出来作为排序区的元素,然后从第二个元素开始往后作为乱序区,从第二个元素开始(并把这个元素复制出来叫做下标元素),分别和排序区的元素比较大小,如果这个元素比排序区的元素小,则把排序区的元素依次往后一位,然后把下标元素复制

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK