> For the complete documentation index, see [llms.txt](https://datastructure-1.gitbook.io/datastructure-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://datastructure-1.gitbook.io/datastructure-docs/readme.md).

# 课程首页

> 本目录将 65 页 PDF 教材整理为可独立阅读、可稳定链接的 Markdown 页面。每章保留原有的理论、示例、小结、思考题，并直接链接到对应的 C++17 实现。

[返回项目主页](https://github.com/Huo0077/DataStructure/blob/main/README.md) | [单页 Markdown 版](https://github.com/Huo0077/DataStructure/blob/main/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E6%95%99%E5%AD%A6%E6%96%87%E6%A1%A3.md) | [PDF 打印版](https://github.com/Huo0077/DataStructure/blob/main/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E6%95%99%E5%AD%A6%E6%96%87%E6%A1%A3.pdf)

## 如何使用

1. 从第 1 章开始顺序学习；每页都包含前置知识、章节导航、小结、思考题和源码入口。
2. 使用页面首尾的“上一章 / 课程目录 / 下一章”链接进行连续阅读。
3. 每个小节都有稳定的 ASCII 锚点。例如 [`#c04-4-6`](/datastructure-docs/di-san-bu-fen-chuan/04-string-matching-kmp.md#c04-4-6) 直接定位到 KMP 匹配过程。
4. 需要全文搜索、离线保存或打印时，可使用单页 Markdown 版或 PDF 版。

## 课程路径

### 第一部分：绪论

|  章  | 学习主题                                                                       | 对应源码                                                                                          |
| :-: | -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|  01 | [复杂度分析与 ADT](/datastructure-docs/di-yi-bu-fen-xu-lun/01-complexity-adt.md) | [`complexity_adt.cpp`](https://github.com/Huo0077/DataStructure/blob/main/complexity_adt.cpp) |

### 第二部分：线性结构

|  章  | 学习主题                                                                               | 对应源码                                                                                                |
| :-: | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|  02 | [线性表](/datastructure-docs/di-er-bu-fen-xian-xing-jie-gou/02-linear-list.md)        | [`Linked list.cpp`](https://github.com/Huo0077/DataStructure/blob/main/Linked%20list.cpp)           |
|  03 | [栈与队列](/datastructure-docs/di-er-bu-fen-xian-xing-jie-gou/03-stacks-and-queues.md) | [`linear_structures.cpp`](https://github.com/Huo0077/DataStructure/blob/main/linear_structures.cpp) |

### 第三部分：串

|  章  | 学习主题                                                                            | 对应源码                                                                                      |
| :-: | ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|  04 | [字符串匹配（KMP）](/datastructure-docs/di-san-bu-fen-chuan/04-string-matching-kmp.md) | [`string_match.cpp`](https://github.com/Huo0077/DataStructure/blob/main/string_match.cpp) |

### 第四部分：树与二叉树

|  章  | 学习主题                                                                                           | 对应源码                                                                                                                                                                                                                                                                |
| :-: | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|  05 | [二叉树基础与遍历](/datastructure-docs/di-si-bu-fen-shu-yu-er-cha-shu/05-binary-tree-basics.md)        | [`binary_tree.cpp`](https://github.com/Huo0077/DataStructure/blob/main/binary_tree.cpp)                                                                                                                                                                             |
|  06 | [二叉搜索树](/datastructure-docs/di-si-bu-fen-shu-yu-er-cha-shu/06-binary-search-tree.md)           | [`binary_tree.cpp`](https://github.com/Huo0077/DataStructure/blob/main/binary_tree.cpp)                                                                                                                                                                             |
|  07 | [堆与优先队列](/datastructure-docs/di-si-bu-fen-shu-yu-er-cha-shu/07-heap-and-priority-queue.md)     | [`heap.cpp`](https://github.com/Huo0077/DataStructure/blob/main/heap.cpp)                                                                                                                                                                                           |
|  08 | [平衡二叉树](/datastructure-docs/di-si-bu-fen-shu-yu-er-cha-shu/08-balanced-binary-search-trees.md) | [`avl_tree.cpp`](https://github.com/Huo0077/DataStructure/blob/main/avl_tree.cpp) / [`redblacktree.cpp`](https://github.com/Huo0077/DataStructure/blob/main/redblacktree.cpp) / [`splaytree.cpp`](https://github.com/Huo0077/DataStructure/blob/main/splaytree.cpp) |
|  09 | [多路搜索树](/datastructure-docs/di-si-bu-fen-shu-yu-er-cha-shu/09-multiway-search-trees.md)        | [`multiwaytree.cpp`](https://github.com/Huo0077/DataStructure/blob/main/multiwaytree.cpp) / [`bplustree.cpp`](https://github.com/Huo0077/DataStructure/blob/main/bplustree.cpp)                                                                                     |
|  10 | [多维搜索树（KD 树）](/datastructure-docs/di-si-bu-fen-shu-yu-er-cha-shu/10-kd-tree.md)                | [`kdtree.cpp`](https://github.com/Huo0077/DataStructure/blob/main/kdtree.cpp)                                                                                                                                                                                       |

### 第五部分：图

|  章  | 学习主题                                                               | 对应源码                                                                        |
| :-: | ------------------------------------------------------------------ | --------------------------------------------------------------------------- |
|  11 | [图论算法](/datastructure-docs/di-wu-bu-fen-tu/11-graph-algorithms.md) | [`graph.cpp`](https://github.com/Huo0077/DataStructure/blob/main/graph.cpp) |

### 第六部分：查找

|  章  | 学习主题                                                                       | 对应源码                                                                                    |
| :-: | -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
|  12 | [哈希表](/datastructure-docs/di-liu-bu-fen-cha-zhao/12-hash-tables.md)        | [`hashing.cpp`](https://github.com/Huo0077/DataStructure/blob/main/hashing.cpp)         |
|  13 | [并查集](/datastructure-docs/di-liu-bu-fen-cha-zhao/13-disjoint-set-union.md) | [`disjointset.cpp`](https://github.com/Huo0077/DataStructure/blob/main/disjointset.cpp) |

### 第七部分：排序

|  章  | 学习主题                                                                     | 对应源码                                                                      |
| :-: | ------------------------------------------------------------------------ | ------------------------------------------------------------------------- |
|  14 | [排序算法](/datastructure-docs/di-qi-bu-fen-pai-xu/14-sorting-algorithms.md) | [`sort.cpp`](https://github.com/Huo0077/DataStructure/blob/main/sort.cpp) |

### 第八部分：高级字符串

|  章  | 学习主题                                                                                        | 对应源码                                                                                                                                                                            |
| :-: | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|  15 | [后缀树与后缀数组](/datastructure-docs/di-ba-bu-fen-gao-ji-zi-fu-chuan/15-suffix-tree-and-array.md) | [`suffixtree.cpp`](https://github.com/Huo0077/DataStructure/blob/main/suffixtree.cpp) / [`suffixarray.cpp`](https://github.com/Huo0077/DataStructure/blob/main/suffixarray.cpp) |

## 附录

| 内容                                                                       | 用途            |
| ------------------------------------------------------------------------ | ------------- |
| [附录 A：数据结构选择速查](/datastructure-docs/fu-lu/appendix-a-quick-reference.md) | 按需求选择数据结构与算法  |
| [附录 B：常见面试题与练习](/datastructure-docs/fu-lu/appendix-b-exercises.md)       | 课后自测与面试准备     |
| [附录 C：常见陷阱与注意事项](/datastructure-docs/fu-lu/appendix-c-pitfalls.md)       | 指针、递归、边界与性能复盘 |

## 仓库构建

```bash
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
ctest --test-dir build --output-on-failure
```

> 建议学习闭环：读完一章，运行对应的 `.cpp` 演示程序，再完成该章思考题。理论、实现与验证会彼此加固。
