随笔分类 - PAT
摘要: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
阅读全文
摘要:According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insert
阅读全文
摘要: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
阅读全文
摘要:An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the
阅读全文
摘要: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
阅读全文
摘要:Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and
阅读全文
摘要:Given an integer with no more than 9 digits, you are supposed to read it in the traditional Chinese way. Output "Fu" first if it is negative. For exam
阅读全文
摘要:It is said that in 2013, there were about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if
阅读全文
摘要:A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer
阅读全文
摘要: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.
阅读全文
摘要:The ranklist of PAT is generated from the status list, which shows the scores of the submittions. This time you are supposed to generate the ranklist
阅读全文
摘要: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
阅读全文
摘要:Given N rational numbers in the form "numerator/denominator", you are supposed to calculate their sum. Input Specification: Each input file contains o
阅读全文
摘要:Given a non-empty tree with root R, and with weight Wi assigned to each tree node Ti. The weight of a path from R to Lis defined to be the sum of the
阅读全文
摘要:People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzi
阅读全文
摘要: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
阅读全文
摘要:Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional
阅读全文
摘要:Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push (
阅读全文
摘要:For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decre
阅读全文
摘要: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
阅读全文

浙公网安备 33010602011771号