1047 Student List for Course ——PAT甲级真题

摘要: 1047 Student List for Course Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, 阅读全文
posted @ 2021-02-13 23:24 翔鸽 阅读(41) 评论(0) 推荐(0) 编辑

1053 Path of Equal Weight——PAT甲级真题

摘要: 1053 Path of Equal Weight 给定一个非空的树,树根为 RR。 树中每个节点 TiTi 的权重为 WiWi。 从 RR 到 LL 的路径权重定义为从根节点 RR 到任何叶节点 LL 的路径中包含的所有节点的权重之和。 现在给定一个加权树以及一个给定权重数字,请你找出树中所有的权 阅读全文
posted @ 2021-02-10 22:11 翔鸽 阅读(87) 评论(0) 推荐(0) 编辑

1004 Counting Leaves ——PAT甲级真题

摘要: 1004 Counting Leaves A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Sp 阅读全文
posted @ 2021-02-10 17:43 翔鸽 阅读(33) 评论(0) 推荐(0) 编辑

1094 The Largest Generation ——PAT甲级真题

摘要: 1094 The Largest Generation A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same genera 阅读全文
posted @ 2021-02-10 16:14 翔鸽 阅读(26) 评论(0) 推荐(0) 编辑

1090 Highest Price in Supply Chain——PAT甲级真题

摘要: 1090 Highest Price in Supply Chain A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving 阅读全文
posted @ 2021-02-10 11:54 翔鸽 阅读(53) 评论(0) 推荐(0) 编辑

1079 Total Sales of Supply Chain ——PAT甲级真题

摘要: 1079 Total Sales of Supply Chain A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)– everyone involved in moving a p 阅读全文
posted @ 2021-02-10 10:52 翔鸽 阅读(84) 评论(0) 推荐(0) 编辑

1102 Invert a Binary Tree——PAT甲级真题

摘要: 1102 Invert a Binary Tree The following is from Max Howell @twitter: Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t 阅读全文
posted @ 2021-02-09 23:00 翔鸽 阅读(114) 评论(0) 推荐(0) 编辑

1086 Tree Traversals Again——PAT甲级真题

摘要: 1086 Tree Traversals Again An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6 阅读全文
posted @ 2021-02-09 17:00 翔鸽 阅读(52) 评论(0) 推荐(0) 编辑

1020 Tree Traversals——PAT甲级真题

摘要: 1020 Tree Traversals Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, y 阅读全文
posted @ 2021-02-08 21:23 翔鸽 阅读(53) 评论(0) 推荐(0) 编辑

1098 Insertion or Heap Sort——PAT甲级真题

摘要: 1098 Insertion or Heap Sort According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output 阅读全文
posted @ 2021-02-07 09:44 翔鸽 阅读(166) 评论(0) 推荐(0) 编辑