摘要: 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-06-08 22:55 赖兴宇 阅读(235) 评论(0) 推荐(0)
摘要: On a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters corresponding to those keys will not appear on sc 阅读全文
posted @ 2018-06-08 22:30 赖兴宇 阅读(120) 评论(0) 推荐(0)
摘要: The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. 阅读全文
posted @ 2018-06-08 22:06 赖兴宇 阅读(147) 评论(0) 推荐(0)
摘要: An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any 阅读全文
posted @ 2018-06-08 20:49 赖兴宇 阅读(139) 评论(0) 推荐(0)
摘要: Zhejiang University has 40000 students and provides 2500 courses. Now given the registered course list of each student, you are supposed to output the 阅读全文
posted @ 2018-06-08 19:08 赖兴宇 阅读(156) 评论(0) 推荐(0)
摘要: Given two sets of integers, the similarity of the sets is defined to be N~c~/N~t~*100%, where N~c~ is the number of distinct common numbers shared by 阅读全文
posted @ 2018-06-08 17:02 赖兴宇 阅读(342) 评论(0) 推荐(0)
摘要: Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the 阅读全文
posted @ 2018-06-08 13:57 赖兴宇 阅读(179) 评论(0) 推荐(0)
摘要: Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given {32, 321, 3214, 0229, 87}, we can 阅读全文
posted @ 2018-06-08 13:20 赖兴宇 阅读(130) 评论(0) 推荐(0)
摘要: The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a produc 阅读全文
posted @ 2018-06-08 13:08 赖兴宇 阅读(486) 评论(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 @ 2018-06-08 12:45 赖兴宇 阅读(244) 评论(0) 推荐(0)
摘要: 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-06-08 00:26 赖兴宇 阅读(151) 评论(0) 推荐(0)