摘要: A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find t 阅读全文
posted @ 2020-02-01 19:32 SteveYu 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 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 @ 2020-02-01 17:57 SteveYu 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID". For example, 123 and 51 are fri 阅读全文
posted @ 2020-02-01 16:50 SteveYu 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each va 阅读全文
posted @ 2020-02-01 16:34 SteveYu 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 1 阅读全文
posted @ 2020-02-01 15:25 SteveYu 阅读(130) 评论(0) 推荐(0) 编辑
摘要: The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the s 阅读全文
posted @ 2020-02-01 01:27 SteveYu 阅读(174) 评论(0) 推荐(0) 编辑
摘要: A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number 阅读全文
posted @ 2020-02-01 01:11 SteveYu 阅读(208) 评论(0) 推荐(0) 编辑
摘要: Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum. Input Specification: Each input file contains one 阅读全文
posted @ 2020-02-01 00:40 SteveYu 阅读(168) 评论(0) 推荐(0) 编辑