摘要: Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and ino 阅读全文
posted @ 2020-05-02 12:42 稀有的猪 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 单链表上的基本操作 1.头插法建立单链表 如果没有设立头结点,则每次插入新节点后,将结点的地址赋值给 。 生成单链表中数据元素的顺序与插入顺序相反。 2.尾插法建立单链表 增加一个 尾指针 。 3.按序号查找结点值 查找第 个结点的值,如果找到,将其保存到 中。 4.按值查找结点 5.插入 方法: 阅读全文
posted @ 2020-04-01 16:57 稀有的猪 阅读(403) 评论(0) 推荐(0) 编辑
摘要: 问题(2013 统考408真题):已知一个整数序列A = (a~0~,a~1~,...,a~n 1~), 其中0≤a~i~≤n (0≤in/2 (0≤p~k~≤n,1≤k≤m),则称 x为A的主元素 。例如,A=(0,5,5,3,5,7,5,5),则5为主元素,又如A=(0, 5, 5,3, 5, 阅读全文
posted @ 2020-03-31 22:11 稀有的猪 阅读(833) 评论(0) 推荐(0) 编辑
摘要: PAT 1018 Public Bike Management(30分) There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over th 阅读全文
posted @ 2020-03-30 23:04 稀有的猪 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 1013 Battle Over Cities(25分) It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all th 阅读全文
posted @ 2020-03-27 21:48 稀有的猪 阅读(140) 评论(0) 推荐(0) 编辑
摘要: ![](https://img2020.cnblogs.com/blog/1516883/202003/1516883-20200327190416510-1799923010.jpg)![](https://img2020.cnblogs.com/blog/1516883/202003/1516883-20200327190421436-2134954321.jpg)![](https://im... 阅读全文
posted @ 2020-03-27 19:05 稀有的猪 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 1030 Travel Plan(30分) A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supp 阅读全文
posted @ 2020-03-27 17:02 稀有的猪 阅读(110) 评论(0) 推荐(0) 编辑