<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://www.33dai.wiki/index.php?action=history&amp;feed=atom&amp;title=08-%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F04-%E9%93%BE%E8%A1%A8</id>
	<title>08-基础算法/04-链表 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://www.33dai.wiki/index.php?action=history&amp;feed=atom&amp;title=08-%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F04-%E9%93%BE%E8%A1%A8"/>
	<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=08-%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95/04-%E9%93%BE%E8%A1%A8&amp;action=history"/>
	<updated>2026-05-20T22:12:58Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=08-%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95/04-%E9%93%BE%E8%A1%A8&amp;diff=429&amp;oldid=prev</id>
		<title>33DAI：​批量导入三三文档</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=08-%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95/04-%E9%93%BE%E8%A1%A8&amp;diff=429&amp;oldid=prev"/>
		<updated>2026-05-20T18:23:59Z</updated>

		<summary type="html">&lt;p&gt;批量导入三三文档&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年5月20日 (三) 18:23的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l68&quot;&gt;第68行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第68行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:基础算法]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:基础算法]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:三三文档]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:三三文档]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key my_wiki:diff:1.41:old-389:rev-429:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>33DAI</name></author>
	</entry>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=08-%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95/04-%E9%93%BE%E8%A1%A8&amp;diff=389&amp;oldid=prev</id>
		<title>33DAI：​导入1个版本</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=08-%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95/04-%E9%93%BE%E8%A1%A8&amp;diff=389&amp;oldid=prev"/>
		<updated>2026-05-20T18:12:13Z</updated>

		<summary type="html">&lt;p&gt;导入1个版本&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年5月20日 (三) 18:12的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;zh-Hans-CN&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（没有差异）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>33DAI</name></author>
	</entry>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=08-%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95/04-%E9%93%BE%E8%A1%A8&amp;diff=388&amp;oldid=prev</id>
		<title>-&gt;Importer：​批量导入三三文档</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=08-%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95/04-%E9%93%BE%E8%A1%A8&amp;diff=388&amp;oldid=prev"/>
		<updated>2026-05-20T16:50:33Z</updated>

		<summary type="html">&lt;p&gt;批量导入三三文档&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== 链表 ==&lt;br /&gt;
&lt;br /&gt;
链表是一种&amp;#039;&amp;#039;&amp;#039;链式存储&amp;#039;&amp;#039;&amp;#039;的线性数据结构，每个节点包含数据和指向下一节点的指针。&lt;br /&gt;
&lt;br /&gt;
=== 单向链表节点 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
struct Node&lt;br /&gt;
{&lt;br /&gt;
    int val;&lt;br /&gt;
    Node* next;&lt;br /&gt;
    Node(int x) : val(x), next(nullptr) {}&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 基本操作 ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! 操作 !! 说明&lt;br /&gt;
|-&lt;br /&gt;
| 插入节点&lt;br /&gt;
| 修改前驱的 &amp;lt;code&amp;gt;next&amp;lt;/code&amp;gt; 指针，新节点的 &amp;lt;code&amp;gt;next&amp;lt;/code&amp;gt; 指向后继&lt;br /&gt;
|-&lt;br /&gt;
| 删除节点&lt;br /&gt;
| 将前驱的 &amp;lt;code&amp;gt;next&amp;lt;/code&amp;gt; 指向后继&lt;br /&gt;
|-&lt;br /&gt;
| 遍历&lt;br /&gt;
| 从头节点开始，依次访问 &amp;lt;code&amp;gt;next&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 查找&lt;br /&gt;
| 从头节点开始遍历，找到目标值&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 用数组模拟链表 ===&lt;br /&gt;
&lt;br /&gt;
O（编程竞赛）中常用数组模拟链表，避免指针操作，速度更快：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
const int MAXN = 100005;&lt;br /&gt;
int val[MAXN];  // 节点值&lt;br /&gt;
int nxt[MAXN];  // 下一个节点的下标&lt;br /&gt;
int head = 0;   // 头节点下标（0 表示空）&lt;br /&gt;
&lt;br /&gt;
// 在节点 p 后插入新节点 x&lt;br /&gt;
int tot = 0;&lt;br /&gt;
void insert(int p, int x)&lt;br /&gt;
{&lt;br /&gt;
    tot++;&lt;br /&gt;
    val[tot] = x;&lt;br /&gt;
    nxt[tot] = nxt[p];&lt;br /&gt;
    nxt[p] = tot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// 删除节点 p 的后一个节点&lt;br /&gt;
void remove(int p)&lt;br /&gt;
{&lt;br /&gt;
    nxt[p] = nxt[nxt[p]];&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 应用场景 ===&lt;br /&gt;
&lt;br /&gt;
* 需要频繁在中间插入/删除的场景&lt;br /&gt;
* 邻接表存图（链式前向星的基础）&lt;br /&gt;
* 链表模拟（如约瑟夫问题）&lt;br /&gt;
&lt;br /&gt;
[[Category:基础算法]]&lt;br /&gt;
[[Category:三三文档]]&lt;br /&gt;
&lt;/div&gt;</summary>
		<author><name>-&gt;Importer</name></author>
	</entry>
</feed>