![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法学习
Wolfswood
这个作者很懒,什么都没留下…
展开
-
算法学习:二、归并排序
合并数组子方法的伪代码: 数组A[p..q] and A[q+1..r];total number is (r - p +1). MERGE(A, p, q, r) n1 = q - p + 1 n2 = r - q let L[1..n1 + 1] and R[1..n2 + 1] be new arrays for i = 1 to n1 L[i] = A[p + i -1] fo...原创 2020-03-15 23:49:05 · 120 阅读 · 0 评论 -
排序算法:一、插入排序
插入排序对少量元素的排序是很有效的。伪代码: INSERTION-SORT(A) for j = 2 to A.length key = a[j] // Insert A[j] into the sorted sequence A[1..j - 1] while i > 0 and A[i] > key A[i+1] = A[i] ...原创 2020-03-15 21:37:33 · 128 阅读 · 0 评论