随笔分类 -  PAT

上一页 1 2 3 4 5 6 ··· 9 下一页
摘要: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 @ 2019-11-21 21:59 自由之翼Az 阅读(142) 评论(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 @ 2019-11-19 23:12 自由之翼Az 阅读(133) 评论(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 @ 2019-11-19 22:44 自由之翼Az 阅读(150) 评论(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 @ 2019-11-19 22:38 自由之翼Az 阅读(145) 评论(0) 推荐(0)
摘要: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 @ 2019-11-19 22:33 自由之翼Az 阅读(132) 评论(0) 推荐(0)
摘要:Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years. When a boy A had a crush on a g 阅读全文
posted @ 2019-09-09 23:55 自由之翼Az 阅读(179) 评论(0) 推荐(0)
摘要:Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal sequences, you are supposed to out 阅读全文
posted @ 2019-09-09 21:32 自由之翼Az 阅读(164) 评论(0) 推荐(0)
摘要:For a student taking the online course "Data Structures" on China University MOOC (http://www.icourse163.org/), to be qualified for a certificate, he/ 阅读全文
posted @ 2019-09-09 21:03 自由之翼Az 阅读(176) 评论(0) 推荐(0)
摘要:Consider a positive integer N written in standard notation with k+1 digits a​i​​ as a​k​​⋯a​1​​a​0​​ with 0 for all i and a​k​​>0. Then N is palindrom 阅读全文
posted @ 2019-09-09 20:02 自由之翼Az 阅读(151) 评论(0) 推荐(0)
摘要: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 either 阅读全文
posted @ 2019-09-09 11:25 自由之翼Az 阅读(219) 评论(0) 推荐(0)
摘要:A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at least one vertex of the set. Now given a graph with 阅读全文
posted @ 2019-09-08 23:05 自由之翼Az 阅读(232) 评论(0) 推荐(0)
摘要:Given a singly linked list, you are supposed to rearrange its elements so that all the negative values appear before all of the non-negatives, and all 阅读全文
posted @ 2019-09-08 22:18 自由之翼Az 阅读(264) 评论(0) 推荐(0)
摘要: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 = 1673 阅读全文
posted @ 2019-09-08 20:20 自由之翼Az 阅读(204) 评论(0) 推荐(0)
摘要: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 Beijing su 阅读全文
posted @ 2019-09-07 23:54 自由之翼Az 阅读(393) 评论(0) 推荐(0)
摘要:Given a syntax tree (binary), you are supposed to output the corresponding infix expression, with parentheses reflecting the precedences of the operat 阅读全文
posted @ 2019-09-07 22:47 自由之翼Az 阅读(226) 评论(0) 推荐(0)
摘要:Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that 阅读全文
posted @ 2019-09-07 21:22 自由之翼Az 阅读(294) 评论(0) 推荐(0)
摘要:The "eight queens puzzle" is the problem of placing eight chess queens on an 8 chessboard so that no two queens threaten each other. Thus, a solution 阅读全文
posted @ 2019-09-07 20:43 自由之翼Az 阅读(178) 评论(0) 推荐(0)
摘要:Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and ino 阅读全文
posted @ 2019-09-06 22:03 自由之翼Az 阅读(198) 评论(0) 推荐(0)
摘要:In graph theory, an Eulerian path is a path in a graph which visits every edge exactly once. Similarly, an Eulerian circuit is an Eulerian path which 阅读全文
posted @ 2019-09-06 21:06 自由之翼Az 阅读(198) 评论(0) 推荐(0)
摘要:Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one 阅读全文
posted @ 2019-09-06 20:18 自由之翼Az 阅读(153) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 ··· 9 下一页