
链表
luer9
假如我年少有为。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
PAT 1032 Sharing (25分)
1032Sharing(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 suffix. For example,loadingandbeingare stored as sho...原创 2020-07-13 23:24:26 · 118 阅读 · 0 评论 -
PAT 1074 Reversing Linked List (链表转置)
1074Reversing Linked List(25分) Given a constantKand a singly linked listL, you are supposed to reverse the links of everyKelements onL. For example, givenLbeing 1→2→3→4→5→6, ifK=3, then yo...原创 2020-05-05 17:17:59 · 138 阅读 · 0 评论 -
数据结构_二叉树
ORZ My blog 概念性的东西就没有说的必要了 #include <iostream> #include <cmath> #include <algorithm> #include <cstring> #include <string> #include <queue> #define Status int #defin...原创 2018-11-18 19:45:20 · 200 阅读 · 1 评论 -
PAT L2-016. 愿天下有情人都是失散多年的兄妹
L2-016. 愿天下有情人都是失散多年的兄妹 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 完全转载:https://blog.youkuaiyun.com/priestessofbirth/article/details/78277297 呵呵。大家都知道五服以内不得通婚,即两个人最近的共同祖先如果在五代以内...转载 2018-05-02 23:49:07 · 279 阅读 · 0 评论 -
PAT 1025. 反转链表
给定一个常数K以及一个单链表L,请编写程序将L中每K个结点反转。例如:给定L为1→2→3→4→5→6,K为3,则输出应该为3→2→1→6→5→4;如果K为4,则输出应该为4→3→2→1→5→6,即最后不到K个元素不反转。输入格式:每个输入包含1个测试用例。每个测试用例第1行给出第1个结点的地址、结点总个数正整数N(<= 105)、以及正整数K(<=N),即要求反转的子链结点的个数。结点...转载 2018-04-26 23:55:26 · 312 阅读 · 0 评论