【PAT】1043 Is It a Binary Search Tree(25 分)
摘要:A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes
阅读全文
posted @
2018-08-26 19:21
Pink.Pig
阅读(253)
推荐(0)
【PAT】1053 Path of Equal Weight(30 分)
摘要:Given a non-empty tree with root R, and with weight Wi assigned to each tree node Ti. The weight of a path from R to L is defined to be the sum
阅读全文
posted @
2018-08-26 16:36
Pink.Pig
阅读(232)
推荐(0)
【PAT】1020 Tree Traversals (25)(25 分)
摘要:Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to ou
阅读全文
posted @
2018-08-24 21:18
Pink.Pig
阅读(153)
推荐(0)
【PAT】1091 Acute Stroke(30 分)
摘要:One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions
阅读全文
posted @
2018-08-24 17:34
Pink.Pig
阅读(973)
推荐(0)
【PAT】1103 Integer Factorization(30 分)
摘要:The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program t
阅读全文
posted @
2018-08-24 15:40
Pink.Pig
阅读(203)
推荐(0)
【PAT】1051 Pop Sequence (25)(25 分)
摘要:Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to tell if a given s
阅读全文
posted @
2018-08-23 18:39
Pink.Pig
阅读(447)
推荐(0)
【PAT】1052 Linked List Sorting (25)(25 分)
摘要:A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key
阅读全文
posted @
2018-08-23 17:45
Pink.Pig
阅读(140)
推荐(0)
【PAT】1060 Are They Equal (25)(25 分)
摘要:If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123*10^5^ wit
阅读全文
posted @
2018-08-22 17:47
Pink.Pig
阅读(185)
推荐(0)
【PAT】1032 Sharing (25)(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 words share the same s
阅读全文
posted @
2018-08-22 17:38
Pink.Pig
阅读(225)
推荐(0)
【PAT】1002. A+B for Polynomials (25)
摘要:1002. A+B for Polynomials (25) This time, you are supposed to find A+B where A and B are two polynomials. Input Each input file contains one test case
阅读全文
posted @
2018-04-28 17:09
Pink.Pig
阅读(283)
推荐(0)
【PAT】1001. A+B Format (20)
摘要:1001. A+B Format (20) Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (u
阅读全文
posted @
2018-04-27 10:07
Pink.Pig
阅读(186)
推荐(0)