Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
XuShaohua committed Jun 25, 2024
1 parent 6e8fb2d commit 56fa5b7
Show file tree
Hide file tree
Showing 26 changed files with 76 additions and 29 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,41 @@
# 数据结构与算法 - Rust 语言实现

使用 Rust 语言实现所有的数据结构与算法.

[在线浏览](https://algs.biofan.org), 或者[下载 pdf 文件](https://share.biofan.org/algs.pdf).

本文档包括了以下几个部分的内容:
1. 第一部分: 数据结构
2. 第二部分: 算法及其实现
3. 第三部分: 专题
4. 第四部分: leetcode 题解

## 反馈问题

欢迎 [反馈问题](https://github.com/xushaohua/TheAlgorithms/issues), 或者提交 PR.

## 搭建本地环境

想在本地搭建本文档的环境也是很容易的.

这些文档记录以 markdown 文件为主, 用 [mdbook](https://github.com/rust-lang/mdBook) 生成网页.

用cargo来安装它: `cargo install mdbook mdbook-linkcheck`

运行 `mdbook build` 命令, 会在`book/`目录里生成完整的电子书的网页版本.

在编写文档的同时, mdbook 工具可以检查文件变更, 按需自动更新.
使用 `mdbook serve` 命令启动一个本地的 web 服务器, 在浏览器中打开 [http://localhost:3000](http://localhost:3000).

### 生成 PDF

如果想生成 pdf, 需要安装 [mdbook-pandoc](https://github.com/max-heller/mdbook-pandoc),
用命令: `cargo install mdbook-pandoc`

并且安装 latex 相应的包:

```bash
sudo apt install pandoc librsvg2-bin texlive-latex-recommended latex-cjk-all texlive-xetex
```

安装好依赖之后, 运行 `./tools/generate-pdf.sh` 命令, 就会生成 `book-pandoc/intro-to-rust.pdf`.
63 changes: 35 additions & 28 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# 目录

- [数据结构与算法 - Rust 语言实现](README.md)
[数据结构与算法 - Rust 语言实现](README.md)

# 第一部分: 数据结构 Data Structures

- [数组 Arrays](array/index.md)
- [数组相关的问题列表](leetcode/tags/array.md)
- [前缀和数组 Prefix Sum Array](array/prefix-sum-array.md)
- [前缀和相关的问题列表](leetcode/tags/prefix-sum.md)
- [后缀数组 Suffix Array](array/suffix-array.md)
- [数组相关的问题列表](leetcode/tags/array.md)
- [动态数组 Vector](vector/index.md)
- [双端队列 Deque](deque/index.md)
- [链表 List](list/index.md)
Expand All @@ -34,11 +34,13 @@
- [二叉搜索树 Binary Search Tree](tree/binary-search-tree/index.md)
- [AVL树](tree/avl-tree/index.md)
- [红黑树 Red-Black Tree](tree/red-black-tree/index.md)
- [字典树 Trie](tree/trie/index.md)
- [多叉树](tree/multiway-tree/index.md)
- [B-Tree](tree/btree/index.md)
- [B+-Tree](tree/b+tree/index.md)
- [多叉树](tree/multiway-tree/index.md)
- [字典树 Trie](tree/trie/index.md)
- [LSM-Tree](tree/lsm-tree/index.md)
- [Fractal-tree](tree/fractal-tree/index.md)
- [MergeTree](tree/merge-tree/index.md)
- [树相关的问题列表](leetcode/tags/tree.md)
- [图 Graph](graph/index.md)
- [深度优先搜索 DFS](graph/dfs.md)
Expand Down Expand Up @@ -92,10 +94,13 @@
- [贪心算法相关的问题列表](leetcode/tags/greedy.md)
- [图算法 Graph](graph/index.md)

# 第三部分: 扩展主题 Extras
# 第三部分: 专题 Extras

- [内存 Memory](memory/index.md)
- [leetcode 问题列表](leetcode/index.md)

# 第四部分: leetcode 题解

- [leetcode 问题分类](leetcode/index.md)
- [数组 Array](leetcode/tags/array.md)
- [二分查找 Binary Search](leetcode/tags/binary-search.md)
- [位运算 Bit Manipulation](leetcode/tags/bit-manipulation.md)
Expand All @@ -115,7 +120,8 @@
- [字符串 String](leetcode/tags/string.md)
- [双指针 Two Pointers](leetcode/tags/two-pointers.md)
- [树 Tree](leetcode/tags/tree.md)
- [0001-0100](leetcode/orders/0001-0100.md)
- [leetcode 题解](leetcode/index.md)
- [0001-0100](leetcode/by-id/0001-0100.md)
- [0001. 两数之和 Two Sum](leetcode/0001.two-sum/index.md)
- [0007. 整数反转 Reverse Integer](leetcode/0007.reverse-integer/index.md)
- [0011. 盛最多水的容器 Container With Most Water](leetcode/0011.container-with-most-water/index.md)
Expand All @@ -137,50 +143,51 @@
- [0083. 删除排序链表中的重复元素 Remove Duplicates from Sorted List](leetcode/0083.remove-duplicates-from-sorted-list/index.md)
- [0088. 合并两个有序数组 Merge Sorted Array](leetcode/0088.merge-sorted-array/index.md)
- [0090. 子集 II Subsets II](leetcode/0090.subsets-ii/index.md)
- [0101-0200](leetcode/orders/0101-0200.md)
- [0101-0200](leetcode/by-id/0101-0200.md)
- [0125. 验证回文串 Valid Palindrome](leetcode/0125.valid-palindrome/index.md)
- [0136. 只出现一次的数字 Single Number](leetcode/0136.single-number/index.md)
- [0137. 只出现一次的数字II Single Number II](leetcode/0137.single-number-ii/index.md)
- [0167. 两数之和 II - 输入有序数组 Two Sum II - Input Array Is Sorted](leetcode/0167.two-sum-ii-input-array-is-sorted/index.md)
- [0191. 位1的个数 Number of 1 Bits](leetcode/0191.number-of-1-bits/index.md)
- [0201-0300](leetcode/orders/0201-0300.md)
- [0201-0300](leetcode/by-id/0201-0300.md)
- [0217. 存在重复元素 Contains Duplicate](leetcode/0217.contains-duplicate/index.md)
- [0219. 存在重复元素II Contains Duplicate II](leetcode/0219.contains-duplicate-ii/index.md)
- [0231. 2的幂 Power of Two](leetcode/0231.power-of-two/index.md)
- [0234. 回文链表 Palindrome Linked List](leetcode/0234.palindrome-linked-list/index.md)
- [0301-0400](leetcode/orders/0301-0400.md)
- [0301-0400](leetcode/by-id/0301-0400.md)
- [0326. 3的幂 Power of Three](leetcode/0326.power-of-three/index.md)
- [0338. 比特位计数 Counting Bits](leetcode/0338.counting-bits/index.md)
- [0342. 4的幂 Power of Four](leetcode/0342.power-of-four/index.md)
- [0349. 两个数组的交集 Intersection of Two Arrays](leetcode/0349.intersection-of-two-arrays/index.md)
- [0350. 两个数组的交集 II Intersection of Two Arrays II](leetcode/0350.intersection-of-two-arrays-ii/index.md)
- [0401-0500](leetcode/orders/0401-0500.md)
- [0401-0500](leetcode/by-id/0401-0500.md)
- [0485. 最大连续1的个数 Max Consecutive Ones](leetcode/0485.max-consecutive-ones/index.md)
- [0501-0600](leetcode/orders/0501-0600.md)
- [0501-0600](leetcode/by-id/0501-0600.md)
- [0532.数组中的数对 K-diff Pairs in an Array](leetcode/0532.k-diff-pairs-in-an-array/index.md)
- [0601-0700](leetcode/orders/0601-0700.md)
- [0601-0700](leetcode/by-id/0601-0700.md)
- [0679. 24 点游戏 24 Game](leetcode/0679.24-game/index.md)
- [0680. 验证回文串 II Valid Palindrome II](leetcode/0680.valid-palindrome-ii/index.md)
- [0701-0800](leetcode/orders/0701-0800.md)
- [0701-0800](leetcode/by-id/0701-0800.md)
- [0707. 设计链表 Design Linked List](leetcode/0707.design-linked-list/index.md)
- [0801-0900](leetcode/orders/0801-0900.md)
- [0901-1000](leetcode/orders/0901-1000.md)
- [0801-0900](leetcode/by-id/0801-0900.md)
- [0901-1000](leetcode/by-id/0901-1000.md)
- [0925. 长按键入 Long Pressed Name](leetcode/0925.long-pressed-name/index.md)
- [0977. 有序数组的平方 Squares of a Sorted Array](leetcode/0977.squares-of-a-sorted-array/index.md)
- [1001-1100](leetcode/orders/1001-1100.md)
- [1101-1200](leetcode/orders/1101-1200.md)
- [1201-1300](leetcode/orders/1201-1300.md)
- [1301-1400](leetcode/orders/1301-1400.md)
- [1401-1500](leetcode/orders/1401-1500.md)
- [1001-1100](leetcode/by-id/1001-1100.md)
- [1101-1200](leetcode/by-id/1101-1200.md)
- [1201-1300](leetcode/by-id/1201-1300.md)
- [1301-1400](leetcode/by-id/1301-1400.md)
- [1401-1500](leetcode/by-id/1401-1500.md)
- [1498. 满足条件的子序列数目 Number of Subsequences That Satisfy the Given Sum Condition](leetcode/1498.number-of-subsequences-that-satisfy-the-given-sum-condition/index.md)
- [1501-1600](leetcode/orders/1501-1600.md)
- [1501-1600](leetcode/by-id/1501-1600.md)
- [1518. 换水问题 Water Bottles](leetcode/1518.water-bottles/index.md)
- [1601-1700](leetcode/orders/1601-1700.md)
- [1701-1800](leetcode/orders/1701-1800.md)
- [1601-1700](leetcode/by-id/1601-1700.md)
- [1701-1800](leetcode/by-id/1701-1800.md)
- [1780. 判断一个数字是否可以表示成三的幂的和 Check if Number is a Sum of Powers of Three](leetcode/1780.check-if-number-is-a-sum-of-powers-of-three/index.md)
- [1801-1900](leetcode/orders/1801-1900.md)
- [1901-2000](leetcode/orders/1901-2000.md)
- [2101-2200](leetcode/orders/2101-2200.md)
- [1801-1900](leetcode/by-id/1801-1900.md)
- [1901-2000](leetcode/by-id/1901-2000.md)
- [2101-2200](leetcode/by-id/2101-2200.md)
- [2108. 找出数组中的第一个回文字符串 Find First Palindromic String in the Array](leetcode/2108.find-first-palindromic-string-in-the-array/index.md)
- [2119. 反转两次的数字 A Number After a Double Reversal](leetcode/2119.a-number-after-a-double-reversal/index.md)
- [参考资料](refs.md)

[参考资料](refs.md)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/leetcode/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# leetcode 问题列表
# leetcode 问题分类

这一章节, 分别基于问题所属的标签, 和问题编号, 列出问题, 方便索引.

Expand Down
1 change: 1 addition & 0 deletions src/tree/fractal-tree/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Fractal-tree
1 change: 1 addition & 0 deletions src/tree/merge-tree/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# MergeTree

0 comments on commit 56fa5b7

Please sign in to comment.