摘要: 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 阅读全文
posted @ 2018-03-12 19:31 王清河 阅读(117) 评论(0) 推荐(0) 编辑
摘要: To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same s 阅读全文
posted @ 2018-03-12 18:58 王清河 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 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, 阅读全文
posted @ 2018-03-12 16:56 王清河 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Mice and Rice is the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given 阅读全文
posted @ 2018-03-12 15:06 王清河 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 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 s 阅读全文
posted @ 2018-03-12 12:55 王清河 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less t 阅读全文
posted @ 2018-03-12 10:47 王清河 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 本题要求实现一种数字加密方法。首先固定一个加密用正整数A,对任一正整数B,将其每1位数字与A的对应位置上的数字进行以下运算:对奇数位,对应位的数字相加后对13取余——这里用J代表10、Q代表11、K代表12;对偶数位,用B的数字减去A的数字,若结果为负数,则再加10。这里令个位为第1位。 输入格式: 阅读全文
posted @ 2018-03-12 10:35 王清河 阅读(199) 评论(0) 推荐(0) 编辑