摘要: Look-and-say sequence is a sequence of integers as the following: D, D1, D111, D113, D11231, D112213111, ... where D is in [0, 9] except 1. The (n+1)s 阅读全文
posted @ 2020-05-02 16:46 SteveYu 阅读(153) 评论(0) 推荐(0) 编辑
摘要: After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the rank 阅读全文
posted @ 2020-05-02 16:33 SteveYu 阅读(201) 评论(0) 推荐(0) 编辑
摘要: A clique is a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjacent. A maximal clique is a clique 阅读全文
posted @ 2020-05-02 14:37 SteveYu 阅读(156) 评论(0) 推荐(0) 编辑
摘要: The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. A binary search tree (BST) i 阅读全文
posted @ 2020-05-02 14:26 SteveYu 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list. Input Specification: Each input file contains 阅读全文
posted @ 2020-05-02 14:22 SteveYu 阅读(155) 评论(0) 推荐(0) 编辑
摘要: The task of this problem is simple: insert a sequence of distinct positive integers into a hash table first. Then try to find another sequence of inte 阅读全文
posted @ 2020-05-02 14:21 SteveYu 阅读(173) 评论(0) 推荐(0) 编辑
摘要: This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed grap 阅读全文
posted @ 2020-05-02 14:19 SteveYu 阅读(176) 评论(0) 推荐(0) 编辑
摘要: In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the 阅读全文
posted @ 2020-05-02 14:16 SteveYu 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game, player #1 阅读全文
posted @ 2020-05-02 14:14 SteveYu 阅读(193) 评论(0) 推荐(0) 编辑
摘要: When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same container, or we might get ourselves in s 阅读全文
posted @ 2020-05-02 14:10 SteveYu 阅读(170) 评论(0) 推荐(0) 编辑
摘要: The "travelling salesman problem" asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shor 阅读全文
posted @ 2020-05-02 14:08 SteveYu 阅读(193) 评论(0) 推荐(0) 编辑
摘要: The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants. Given any two nodes in a bin 阅读全文
posted @ 2020-05-02 14:04 SteveYu 阅读(190) 评论(0) 推荐(0) 编辑
摘要: In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) for recruitment. The content is supe 阅读全文
posted @ 2020-05-02 14:02 SteveYu 阅读(170) 评论(0) 推荐(0) 编辑
摘要: A registration card number of PAT consists of 4 parts: the 1st letter represents the test level, namely, T for the top level, A for advance and B for 阅读全文
posted @ 2020-05-02 14:01 SteveYu 阅读(182) 评论(0) 推荐(0) 编辑
摘要: A proper vertex coloring is a labeling of the graph's vertices with colors such that no two vertices sharing the same edge have the same color. A colo 阅读全文
posted @ 2020-05-02 13:57 SteveYu 阅读(134) 评论(0) 推荐(0) 编辑
摘要: In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the 阅读全文
posted @ 2020-05-02 13:51 SteveYu 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 7-1 Knuth洗牌法 (20分) Knuth 洗牌法是生成 { 1, 2, ..., n } 的一个随机重排列的算法。与每次反复随机生成一个数字,直到获得一个不重复的新数字的算法不同,Knuth 洗牌法从原始序列 { 1, 2, ..., n } 开始,逐次洗牌。洗牌的方法是从左到右,每轮从没确 阅读全文
posted @ 2020-05-02 04:23 SteveYu 阅读(498) 评论(0) 推荐(0) 编辑