MergeSort

摘要: Merge sortis anO(nlogn)comparison-basedsorting algorithm. Most implementations produce astable sort, which means that the implementation preserves the input order of equal elements in the sorted output. Merge sort is adivide and conquer algorithmthat was invented byJohn von Neumannin 1945.Conceptual 阅读全文
posted @ 2013-03-29 09:21 melotang 阅读(165) 评论(0) 推荐(0)

SelectionSort

摘要: Selection sortis asorting algorithm.It hasO(n2) time complexity, making it inefficient on large lists, and generally performs worse than the similarinsertion sort. Selection sort is noted for its simplicity, and it has performance advantages over more complicated algorithms in certain situations, pa 阅读全文
posted @ 2013-03-28 23:03 melotang 阅读(311) 评论(0) 推荐(0)

InsertionSort

摘要: Insertionsortisasimplesortingalgorithmwhichismuchlessefficientonlargeliststhanmoreadvancedalgorithmssuchasquicksort,heapsort,ormergesort.<Introductiontoalgorithm> Insertionsortworksthewaymanypeoplesortahandofplayingcards.Westartwithanemptylefthandandthecardsfacedownonthetable.Wethenremove... 阅读全文
posted @ 2013-03-28 22:10 melotang 阅读(133) 评论(0) 推荐(0)