随笔分类 - PTA甲级
摘要:题目: In the big cities, the subway systems always look so complex to the visitors. To give you some sense, the following figure shows the map of Beijin
阅读全文
摘要:题目: Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z =
阅读全文
摘要:题目: There is a kind of balanced binary search tree named red-black tree in the data structure. It has the following 5 properties: (1) Every node is ei
阅读全文
摘要:题目: Consider a positive integer N written in standard notation with k+1 digits ai as ak⋯a1a0 with 0≤ai<10 for all i and ak>0. Then N is palindro
阅读全文
摘要:题目: For a student taking the online course "Data Structures" on China University MOOC (http://www.icourse163.org/), to be qualified for a certificate,
阅读全文
摘要:题目: Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal sequences, you are supposed to
阅读全文
摘要:题目: After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the
阅读全文
摘要:题目: 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 cl
阅读全文
摘要:题目: 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 (BS
阅读全文
摘要:题目: 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
阅读全文
摘要:题目 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 c
阅读全文
摘要: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
阅读全文
摘要:题目: Given a sequence of positive integers and another positive integer p. The sequence is said to be a perfect sequence if M≤m×p where M and m are the
阅读全文
摘要:题目: There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at a
阅读全文
摘要:题目: As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by som
阅读全文
摘要:题目: 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
阅读全文
摘要:题目: Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in the same picture belong to the same tree. You
阅读全文
摘要:题目: When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A s
阅读全文
摘要:题目: 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
阅读全文
摘要:题目: 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
阅读全文