上一页 1 ··· 18 19 20 21 22
摘要: Source: PAT A 1154 Vertex Coloring (25 分) Description: A proper vertex coloring is a labeling of the graph's vertices with colors such that no two ver 阅读全文
posted @ 2019-05-10 22:51 林東雨 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Date:2019-05-10 20:12:27 直接插入排序 时间复杂度:O(N^2) 空间复杂度:O(1) 稳定性:不会出现相同元素相对位置发生变化 适用性:顺序存储和链式存储 折半插入排序(二分插入排序) 减少了比较元素的次数,约为O(Nlog2N) 由于没有并未减少移动元素的次数,时间复杂度 阅读全文
posted @ 2019-05-10 20:47 林東雨 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Source: PAT_A1098 Insertion or Heap Sort (25 分) Description: According to Wikipedia: Insertion sort iterates, consuming one input element each repetit 阅读全文
posted @ 2019-05-09 22:43 林東雨 阅读(318) 评论(0) 推荐(0) 编辑
摘要: Date:2019-05-08 21:27:07 选择排序: 算法思想:从A[i~n]选择最小的关键字,置于A[i]; 接下来介绍的堆排序属于选择排序的一种; 堆的存储: 采用二叉树的静态存储方式; 结点下标的取值范围【1<= i <= N】; 左孩子下标【i*2】,右孩子下标【i*2+1】; 叶子 阅读全文
posted @ 2019-05-08 21:41 林東雨 阅读(338) 评论(0) 推荐(0) 编辑
摘要: Source: PAT A1155 Heap Paths (30 分) Description: In computer science, a heap is a specialized tree-based data structure that satisfies the heap proper 阅读全文
posted @ 2019-05-07 23:52 林東雨 阅读(344) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22