插入排序的设计实现分析比较.doc插入排序的设计、实现、分析与比较一、【设计题目】:插入排序的设计、实现、分析与比较二、[摘要和关键字】(中文和英文)摘要:插入排序可分为直接插入排序,折半插入排序,2-路插入排序,表插入排序,希尔排序。这里我主要设计分析的是直接插入排序和希尔排序,而其他的,只是随便的说说算法,和一些可取之处。直接插入排序是一种最简单的排序方法,它的基木操作是将一个记录插入到已排好的有序表中。从某些方面来看,直接插入排序的算法简单,就其效率而言,其时间殳杂度为O(n*n),但当待排序记录的数量n很小,用的会很好,但当n较大时,则不易用此种方法,那就可以用折半插入排序,2-路插入排序。就折半插入排序而言,它减少了关键字比较的次数,其复杂度没有变化,而2-路插入排序2-路插入排序是在折半插入排序改进得来的,其目的是减少排序过程中移动记录的次数,但为此需要n个记录的辅助空间。最后表插入排序是一个有序链表。希尔排序,又称缩小增量排序,在时间效率上比以前儿种有较大的改进,下面简单的介绍一下它的思想:在直接插入排序算法中,每次插入一个数,使有序序列只增加1个节点,并且对插入下一个数没有提供任何帮助。如果比较相隔较远距离(称为增量)的数,使得数移动时能跨过多个元素,则进行一次比较就E能消除多个元素交换。。算法先将要排序的一组数按某个增晕d分成若干组,,然后再用一个较小的增量对它进行,在每组中再进行排序。当增量减到1时,整个要排序的数被分成一组,排序完成。Insertingto1ineupprefacecanisdividedintoinsertto1ineuptheprefacedirectly,breakingthehalfinserttolineupthepreface,2-theroadinsertstolineupthepreface,thewatchinsertstolineupthepreface,,butother,justsaythecalculatewayliterally,,,insertingthecalculatewaythatlineuptheprefacedirectlysimple,inregardtoitsefficiency,plicacyaquantityforis0(n*n),butwhentreatingliningupprefacerecordnisverysmall,usingofwou1dbeverygood,butwhennisbigger,thenusingthethiskindmethodnoteasily,thatcanusetobreakthehalfinserttolineupthepreface,2-,parison,plicateddegreedidnotchange,but2-theroadinsertstolineupthepreface2-theroadinsertstolineuptheprefaceisbreakingthehalfinsertstolineupwhatprefaceimprovementget,itspurposeisassistancespacethatnumberoftimestoreduceto1ineuptomovetherecordintheprefaceprocess,,callingtocontracttoincreasethedealtherowtheprefaceagain,attimeefficiencyl
插入排序的设计实现分析比较 来自淘豆网www.taodocs.com转载请标明出处.