上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页

1113 Integer Set Partition (25 分)集合分割

摘要: 1113 Integer Set Partition (25 分) Given a set of NNN (>1> 1>1) positive integers, you are supposed to partition them into two disjoint sets A1A_1A​1​​ 阅读全文
posted @ 2019-01-22 14:47 ZhangのBlog 阅读(570) 评论(0) 推荐(0) 编辑

1120 Friend Numbers (20 分)set的使用

摘要: 1120 Friend Numbers (20 分) Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID". For 阅读全文
posted @ 2019-01-22 14:19 ZhangのBlog 阅读(149) 评论(0) 推荐(0) 编辑

1099 Build A Binary Search Tree (30 分)

摘要: 1099 Build A Binary Search Tree (30 分) A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left 阅读全文
posted @ 2019-01-22 14:05 ZhangのBlog 阅读(307) 评论(0) 推荐(0) 编辑

1092 To Buy or Not to Buy (字符串删除)

摘要: 1092 To Buy or Not to Buy (20 分) Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. Ther 阅读全文
posted @ 2019-01-22 13:24 ZhangのBlog 阅读(101) 评论(0) 推荐(0) 编辑

1127 ZigZagging on a Tree (30 分)树的层次遍历

摘要: 1127 ZigZagging on a Tree (30 分) Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by 阅读全文
posted @ 2019-01-22 12:46 ZhangのBlog 阅读(327) 评论(0) 推荐(0) 编辑

1155 Heap Paths (30 分)判断是否是一个堆

摘要: 1155 Heap Paths (30 分) In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node 阅读全文
posted @ 2019-01-21 21:06 ZhangのBlog 阅读(337) 评论(0) 推荐(0) 编辑

1032 Sharing (25 分)使用set实现

摘要: 1032 Sharing (25 分) To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the wo 阅读全文
posted @ 2019-01-21 16:49 ZhangのBlog 阅读(160) 评论(0) 推荐(0) 编辑

1032 Sharing (25 分)(PAT甲级,静态链表)

摘要: 1032 Sharing (25 分) To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the wo 阅读全文
posted @ 2019-01-21 16:25 ZhangのBlog 阅读(483) 评论(0) 推荐(0) 编辑

1031 Hello World for U (不等式计算)

摘要: 1031 Hello World for U (20 分) Given any string of NNN (≥5\ge 5≥5) characters, you are asked to form the characters into the shape of U. For example, h 阅读全文
posted @ 2019-01-21 14:28 ZhangのBlog 阅读(117) 评论(0) 推荐(0) 编辑

1030 Travel Plan (DFS)

摘要: 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 su 阅读全文
posted @ 2019-01-21 14:00 ZhangのBlog 阅读(166) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页