随笔分类 - Pat
摘要:1113 Integer Set Partition (25 分) 1113 Integer Set Partition (25 分) 1113 Integer Set Partition (25 分) Given a set of N (>) positive integers, you are
阅读全文
摘要:1115 Counting Nodes in a BST (30 分) 1115 Counting Nodes in a BST (30 分) 1115 Counting Nodes in a BST (30 分) A Binary Search Tree (BST) is recursively
阅读全文
摘要:1119 Pre- and Post-order Traversals (30 分) 1119 Pre- and Post-order Traversals (30 分) 1119 Pre- and Post-order Traversals (30 分) Suppose that all the
阅读全文
摘要:1118 Birds in Forest (25 分) 1118 Birds in Forest (25 分) 1118 Birds in Forest (25 分) Some scientists took pictures of thousands of birds in a forest. A
阅读全文
摘要:1117 Eddington Number (25 分) 1117 Eddington Number (25 分) 1117 Eddington Number (25 分) British astronomer Eddington liked to ride a bike. It is said t
阅读全文
摘要:1116 Come on! Let's C (20 分) 1116 Come on! Let's C (20 分) 1116 Come on! Let's C (20 分) "Let's C" is a popular and fun programming contest hosted by th
阅读全文
摘要:1135 Is It A Red-Black Tree (30 分) 1135 Is It A Red-Black Tree (30 分) 1135 Is It A Red-Black Tree (30 分) There is a kind of balanced binary search tre
阅读全文
摘要:1066 Root of AVL Tree (25 分) 1066 Root of AVL Tree (25 分) 1066 Root of AVL Tree (25 分) An AVL tree is a self-balancing binary search tree. In an AVL t
阅读全文
摘要:1123 Is It a Complete AVL Tree (30 分) 1123 Is It a Complete AVL Tree (30 分) 1123 Is It a Complete AVL Tree (30 分) An AVL tree is a self-balancing bina
阅读全文
摘要:1122 Hamiltonian Cycle (25 分) 1122 Hamiltonian Cycle (25 分) 1122 Hamiltonian Cycle (25 分) The "Hamilton cycle problem" is to find a simple cycle that
阅读全文
摘要:1121 Damn Single (25 分) 1121 Damn Single (25 分) 1121 Damn Single (25 分) "Damn Single (单身狗)" is the Chinese nickname for someone who is being single. Y
阅读全文
摘要:1120 Friend Numbers (20 分) 1120 Friend Numbers (20 分) 1120 Friend Numbers (20 分) Two integers are called "friend numbers" if they share the same sum o
阅读全文
摘要:1127 ZigZagging on a Tree (30 分) 1127 ZigZagging on a Tree (30 分) 1127 ZigZagging on a Tree (30 分) Suppose that all the keys in a binary tree are dist
阅读全文
摘要:1126 Eulerian Path (25 分) 1126 Eulerian Path (25 分) 1126 Eulerian Path (25 分) In graph theory, an Eulerian path is a path in a graph which visits ever
阅读全文
摘要:1125 Chain the Ropes (25 分) 1125 Chain the Ropes (25 分) 1125 Chain the Ropes (25 分) Given some segments of rope, you are supposed to chain them into o
阅读全文
摘要:1124 Raffle for Weibo Followers (20 分) 1124 Raffle for Weibo Followers (20 分) 1124 Raffle for Weibo Followers (20 分) John got a full mark on PAT. He w
阅读全文
摘要:1131 Subway Map (30 分) 1131 Subway Map (30 分) 1131 Subway Map (30 分) In the big cities, the subway systems always look so complex to the visitors. To
阅读全文
摘要:1130 Infix Expression (25 分) 1130 Infix Expression (25 分) 1130 Infix Expression (25 分) Given a syntax tree (binary), you are supposed to output the co
阅读全文
摘要:1129 Recommendation System (25 分) 1129 Recommendation System (25 分) 1129 Recommendation System (25 分) Recommendation system predicts the preference th
阅读全文
摘要:1128 N Queens Puzzle (20 分) 1128 N Queens Puzzle (20 分) 1128 N Queens Puzzle (20 分) The "eight queens puzzle" is the problem of placing eight chess qu
阅读全文

浙公网安备 33010602011771号