摘要: 插入排序非常类似于整扑克牌。在开始摸牌时,左手是空的,牌面朝下放在桌上。接着,一次从桌上摸起一张牌,并将它插入到左手一把牌中的正确位置上。为了找到这张牌的正确位置,要将它与手中已有的牌从右到左地进行比较。无论什么时候,左手中的牌都是排好序的。也许你没有意识到,但其实你的思考过程是这样的:现在抓到一张 阅读全文
posted @ 2019-04-29 16:23 雪山飞鱼 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 一、冒泡排序(Bubble sort) Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list to be sor 阅读全文
posted @ 2019-04-29 09:16 雪山飞鱼 阅读(370) 评论(0) 推荐(0) 编辑