2018年8月26日
摘要: 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 阅读(242) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty tree with root R, and with weight W​i​​ assigned to each tree node T​i​​. The weight of a path from R to L is defined to be the sum 阅读全文
posted @ 2018-08-26 16:36 Pink.Pig 阅读(220) 评论(0) 推荐(0) 编辑
  2018年8月24日
摘要: 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 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(961) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(181) 评论(0) 推荐(0) 编辑
  2018年8月23日
摘要: 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 阅读(436) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(132) 评论(0) 推荐(0) 编辑
  2018年8月22日
摘要: 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 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(211) 评论(0) 推荐(0) 编辑
  2018年8月19日
摘要: 给定任一个各位数字不完全相同的4位正整数,如果我们先把4个数字按非递增排序,再按非递减排序,然后用第1个数字减第2个数字,将得到一个新的数字。一直重复这样做,我们很快会停在有“数字黑洞”之称的6174,这个神奇的数字也叫Kaprekar常数。 例如,我们从6767开始,将得到 7766 - 6677 阅读全文
posted @ 2018-08-19 21:17 Pink.Pig 阅读(235) 评论(0) 推荐(0) 编辑