摘要: Source: PAT A1148 Werewolf - Simple Version (20 分) Description: Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the wer 阅读全文
posted @ 2019-05-28 21:58 林東雨 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Source: PAT A1135 Is It A Red-Black Tree (30 分) Description: There is a kind of balanced binary search tree named red-black tree in the data structure 阅读全文
posted @ 2019-05-28 21:25 林東雨 阅读(250) 评论(0) 推荐(0) 编辑
摘要: Source: PAT A1137 Final Grading (25 分) Description: For a student taking the online course "Data Structures" on China University MOOC (http://www.icou 阅读全文
posted @ 2019-05-27 18:56 林東雨 阅读(360) 评论(0) 推荐(0) 编辑
摘要: Source: PAT A1138 Postorder Traversal (25 分) Description: Suppose that all the keys in a binary tree are distinct positive integers. Given the preorde 阅读全文
posted @ 2019-05-26 23:00 林東雨 阅读(273) 评论(0) 推荐(0) 编辑
摘要: Source: PAT A1128 N Queens Puzzle (20 分) Description: The "eight queens puzzle" is the problem of placing eight chess queens on an 8 chessboard so tha 阅读全文
posted @ 2019-05-25 11:17 林東雨 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Date:2019-05-25 11:06:04 回溯法: 如果达到递归边界前的某层,由于事实导致无需任何一个子问题继续递归,便可以直接返回上一层 Description: 8*8的棋盘上任意放置八个皇后棋子,使得任意两个皇后不在同一行,同一列,同一对角线 Code: 阅读全文
posted @ 2019-05-25 11:15 林東雨 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Source: PAT A1132 Cut Integer (20 分) Description: Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long int 阅读全文
posted @ 2019-05-24 21:59 林東雨 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Source: PAT_A1136 A Delayed Palindrome (20 分) Description: Consider a positive integer N written in standard notation with k+1 digits a​i​​ as a​k​​⋯a 阅读全文
posted @ 2019-05-24 21:36 林東雨 阅读(168) 评论(0) 推荐(0) 编辑
摘要: Source: PAT A1140 Look-and-say Sequence (20 分) Description: Look-and-say sequence is a sequence of integers as the following: where D is in [0, 9] exc 阅读全文
posted @ 2019-05-24 11:39 林東雨 阅读(233) 评论(0) 推荐(0) 编辑
摘要: Source: PAT A1141 PAT Ranking of Institutions (25 分) Description: After each PAT, the PAT Center will announce the ranking of institutions based on th 阅读全文
posted @ 2019-05-24 10:42 林東雨 阅读(249) 评论(0) 推荐(0) 编辑