PAT 1052 Linked List Sorting (25分) 结构体排序而已
A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integer key and a Next pointer to the next structure.
PAT 1051 Pop Sequence (25分) 模拟入栈
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 sequence of numbers is a possible pop sequence of the stack.
PAT1050 String Subtraction (20分) 用布尔数组
Given two strings S1 and S2 , S=S1 −S2 is defined to be the remaining string after taking all the characters in S2 from S1 . Your task is simply to calculate S1 −S2 for any given strings.
PAT 1049 Counting Ones (30分) 编程之美--1的个数
The task is simple: given any positive integer N, you are supposed to count the total number of 1's in the decimal form of the integers from 1 to N. For example, given N being 12, there are five 1's in 1, 10, 11, and 12.
PAT 1048 Find Coins (25分) 硬币面值做数组下标即排序
Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However, there was a special requirement of the payment: for each bill, she could only use exactly two coins to pay the exact amount.
PAT1047 Student List for Course (25分）避免运行超时（内存溢出）
Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses.
PAT 1046 Shortest Distance (20分)
The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits.
PAT 1044 Shopping in Mars (25分) 二分法
Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$).
PAT 1043 Is It a Binary Search Tree (25分) 由前序遍历得到二叉搜索树的后序遍历
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:
PAT1042 Shuffling Machine (20分) 用1-54代替点数更方便哦
Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid "inside jobs" where employees collaborate with gamblers by performing inadequate shuffles, many casinos employ automatic shuffling machines.