读书笔记
dijk
这个作者很懒,什么都没留下…
展开
-
BUBBLESORT: INTRODUCTION TO ALGORITHMS
Pseudo codeBUBBLESORT(A) 1 for i=1 to A.length-1 2 for j=A.length downto i+1 3 if A[j] < A[j-1] 4 exchange A[j] with A[j-1]Reference<< Introduction to Algorithms >> Thi原创 2015-05-31 13:06:20 · 482 阅读 · 0 评论 -
INSERTION-SORT: INTRODUCTION TO ALGORITHMS
Pseudo codeINSERTION-SORT(A)1 for j=2 to A.length2 key = A[j]3 //Insert A[j] into the sorted sequence A[1..j-1]4 i = j-15 while i>0 and A[i]>key6 A[i+1] = A[i]7 i原创 2015-05-31 13:22:39 · 574 阅读 · 0 评论 -
MERGE-SORT: INTRODUCTION TO ALGORITHMS
Merge sort:归并排序Animation An example of merge sort. First divide the list into the smallest unit (1 element), then compare each element with the adjacent list to sort and merge the two adjacent lists.原创 2015-05-31 13:17:01 · 706 阅读 · 0 评论