正在加载图片...
Insertion sort INSERTION-SORT(A, n) D Al.n forj←2ton do key←Aj pseudocode while i>0 and a[i> key doA[i+1]←A[d Ai+1=key sorted ey Day 1 Introduction to Algorithms 17Day 1 Introduction to Algorithms L1.7 Insertion sort INSERTION-SORT (A, n) ⊳ A[1 . . n] for j ← 2 to n do key ← A[ j] i ← j – 1 while i > 0 and A[i] > key do A[i+1] ← A[i] i ← i – 1 A[i+1] = key “pseudocode” i j key sorted A: 1 n
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有