二叉堆

摘要: 堆 如何手写一个堆? 首先堆是一颗完全二叉树,结合完全二叉树的性质我们可以利用数组来存储一棵树。每个结点的编号从1开始。 插入一个数。 heap[++size] = x; up(size); 求集合当中的最小值。heap[1] 删除最小值。 heap[1] = heap[size]; size--; 阅读全文
posted @ 2021-02-06 14:36 翔鸽 阅读(40) 评论(0) 推荐(0) 编辑

1107 Social Clusters——PAT甲级真题

摘要: 1107 Social Clusters When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the 阅读全文
posted @ 2021-02-06 09:28 翔鸽 阅读(77) 评论(0) 推荐(0) 编辑

1095 Cars on Campus——PAT甲级真题

摘要: 1095 Cars on Campus Zhejiang University has 6 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the 阅读全文
posted @ 2021-02-03 17:25 翔鸽 阅读(56) 评论(0) 推荐(0) 编辑

1080 Graduate Admission——PAT甲级真题

摘要: 1080 Graduate Admission——PAT甲级练习题 It is said that in 2013, there were about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang 阅读全文
posted @ 2021-02-03 09:56 翔鸽 阅读(64) 评论(0) 推荐(0) 编辑