pat考试

圣保罗的大教堂21 小时前
pat考试
1170 Safari Park (25)A safari park(野生动物园)has K species of animals, and is divided into N regions. The managers hope to spread the animals to all the regions, but not the same animals in the two neighboring regions. Of course, they also realize that this is an NP complete prob
圣保罗的大教堂3 天前
pat考试
1166 Summit (25)A summit (峰会) is a meeting of heads of state or government. Arranging the rest areas for the summit is not a simple job. The ideal arrangement of one area is to invite those heads so that everyone is a direct friend of everyone.
圣保罗的大教堂6 天前
pat考试
1164 Good in C (20)When your interviewer asks you to write "Hello World" using C, can you do as the following figure shows?
圣保罗的大教堂6 天前
pat考试
1161 Merging Linked Lists (25)Given two singly linked lists L1=a1→a2→⋯→an−1→an and L2=b1→b2→⋯→bm−1→bm. If n≥2m, you are supposed to reverse and merge the shorter one into the longer one to obtain a list like a1→a2→bm→a3→a4→bm−1⋯. For example, given one list being 6→7 and the other one
圣保罗的大教堂7 天前
pat考试
1156 Sexy Primes (20)Sexy primes are pairs of primes of the form (p, p+6), so-named since "sex" is the Latin word for "six". (Quoted from http://mathworld.wolfram.com/SexyPrimes.html)
圣保罗的大教堂10 天前
pat考试
1150 Travelling Salesman Problem (25)The "travelling salesman problem" asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city and returns to the origin city?" It is an NP-hard problem in co
圣保罗的大教堂17 天前
pat考试
1133 Splitting A Linked List (25)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 the values in [0, K] appear before all those greater than K. The order of the elements inside each class
圣保罗的大教堂1 个月前
pat考试
1097 Deduplication on a Linked List (25)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 value K, only the first node of which the value or absolute value of its key equals K will be kept. At the
圣保罗的大教堂1 个月前
pat考试
1089 Insert or Merge (25)According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, finds the location it belongs within the sorted list, an
圣保罗的大教堂1 个月前
pat考试
1081 Rational Sum (20)Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum.
圣保罗的大教堂1 个月前
pat考试
1083 List Grades (25)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 output those student records of which the grades are in a given interval.
圣保罗的大教堂2 个月前
pat考试
1074 Reversing Linked List (25)Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, if K=3, then you must output 3→2→1→6→5→4; if K=4, you must output 4→3→2→1→5→6.
圣保罗的大教堂2 个月前
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. Now given a linked list, you are supposed to sort the structure
圣保罗的大教堂2 个月前
pat考试
1047 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.
圣保罗的大教堂3 个月前
pat考试
1028 List Sorting (25)Excel can sort records according to any column. Now you are supposed to imitate this function.
哈哈,柳暗花明3 个月前
pat考试
软件设计师笔记-数据结构数据元素的集合及元素间的相互关系和构造方法。每个节点有两个指针,分别指出直接前驱和直接后继。尾节点指针指向第一个节点。
绯樱殇雪3 个月前
c++·pat考试
编程题 7-29 删除字符串中的子串【PAT】编程练习题目集目录输入 2 2 2 个字符串 S 1 S1 S1 和 S 2 S2 S2,要求删除字符串 S 1 S1 S1 中出现的所有子串 S 2 S2 S2,即结果字符串中不能包含 S 2 S2 S2。
绯樱殇雪4 个月前
c++·pat考试
编程题 7-14 求整数段和【PAT】编程练习题目集目录给定两个整数 A A A 和 B B B,输出从 A A A 到 B B B 的所有整数以及这些数的和。
C盘清理4 个月前
考研·倒计时·pat考试·高考·倒计时软件·日期倒计时
2025考研倒计时 考研时间公布了 你准备好复习冲刺了吗?2025考研倒计时 考研时间公布了 你准备好复习冲刺了吗?今年的考研时间终于公布了:正式报名时间2024.10.15-2024.10.28,初试时间12月21日,相信很多学子们已经做好冲刺的准备了。
绯樱殇雪4 个月前
c·pat考试
函数题 6-8 简单阶乘计算【PAT】编程练习题目集目录要求实现一个计算非负整数阶乘的简单函数。int Factorial( const int N );