pat甲级链表
月下独喝
这个作者很懒,什么都没留下…
展开
-
pat甲级 1032Sharing(链表)
1032 Sharing (25 分)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 sublist if they share the same...原创 2019-06-21 22:52:21 · 263 阅读 · 0 评论 -
1133 Splitting A Linked List (链表)
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 i...原创 2019-06-21 22:54:32 · 105 阅读 · 0 评论 -
1097 Deduplication on a Linked List(链表 结构体与非结构体实现)
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,...原创 2019-06-21 22:59:36 · 118 阅读 · 0 评论 -
1074 Reversing Linked List(翻转链表 revert)
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 y...原创 2019-06-21 23:06:32 · 208 阅读 · 0 评论 -
1052 Linked List Sorting(链表排序)
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 pointe...原创 2019-06-21 23:10:14 · 193 阅读 · 0 评论 -
关于pat甲级链表题的总结
1.链表类型题 输入一般 是起始结点的地址,与结点的个数n 然后n行都是 地址,数据 , 下一个结点的地址, 下一个地址连接点可能会发生改变, 但原结点地址一般不会改变 可以选择结构体方式存储, 或者分开(next[maxsize], data[maxsize]),2. 设定一个 b数组存放满足题意要求结点的地址3. 输出格式一般是 %05d %d %05d (结点的地址, 结...原创 2019-06-21 23:16:41 · 202 阅读 · 0 评论