1051 Commits

Author SHA1 Message Date
Yudong Jin
2213a59ff6 Update acknowledgements (#1842)
* Update acknowledgements.

* Sync zh and zh-hant versions.
2026-01-04 16:26:46 +08:00
Yudong Jin
f304c8385a Update buttons in the landing pages. (#1841) 2026-01-02 05:44:19 +08:00
Yudong Jin
0586e611b7 Update buttons in READMEs (#1840)
* Update READMEs

* Update buttons in READMEs.
2026-01-02 05:16:24 +08:00
Yudong Jin
666da25a2a Prepare 1.3.0 release (#1838)
* Update the contributors list.

* Update the version number.

* Sync zh and zh-hant versions.

* Move epub builder to the utils branch.

* Optimize all figure files using pngquant.

* Update copyright.

* Update Acknowledgements.

* Update buttons in README.
2026-01-02 03:37:38 +08:00
Yudong Jin
10f76bd59a Remove incomplete zig code from docs. (#1837) 2025-12-31 19:47:59 +08:00
Yudong Jin
2778a6f9c7 Translate all code to English (#1836)
* Review the EN heading format.

* Fix pythontutor headings.

* Fix pythontutor headings.

* bug fixes

* Fix headings in **/summary.md

* Revisit the CN-to-EN translation for Python code using Claude-4.5

* Revisit the CN-to-EN translation for Java code using Claude-4.5

* Revisit the CN-to-EN translation for Cpp code using Claude-4.5.

* Fix the dictionary.

* Fix cpp code translation for the multipart strings.

* Translate Go code to English.

* Update workflows to test EN code.

* Add EN translation for C.

* Add EN translation for CSharp.

* Add EN translation for Swift.

* Trigger the CI check.

* Revert.

* Update en/hash_map.md

* Add the EN version of Dart code.

* Add the EN version of Kotlin code.

* Add missing code files.

* Add the EN version of JavaScript code.

* Add the EN version of TypeScript code.

* Fix the workflows.

* Add the EN version of Ruby code.

* Add the EN version of Rust code.

* Update the CI check for the English version  code.

* Update Python CI check.

* Fix cmakelists for en/C code.

* Fix Ruby comments
2025-12-31 07:44:52 +08:00
Yudong Jin
2db8f741a8 Add starfield.js in the landing page. (#1833) 2025-12-27 05:33:45 +08:00
Ikko Eltociear Ashimine
954c45864b docs: add Japanese translate documents (#1812)
* docs: add Japanese documents (`ja/docs`)

* docs: add Japanese documents (`ja/codes`)

* docs: add Japanese documents

* Remove pythontutor blocks in ja/

* Add an empty at the end of each markdown file.

* Add the missing figures (use the English version temporarily).

* Add index.md for Japanese version.

* Add index.html for Japanese version.

* Add missing index.assets

* Fix backtracking_algorithm.md for Japanese version.

* Add avatar_eltociear.jpg. Fix image links on the Japanese landing page.

* Add the Japanese banner.

---------

Co-authored-by: krahets <krahets@163.com>
2025-10-17 05:04:43 +08:00
Yudong Jin
2487a27036 Update the Warp link. (#1815)
* Bug fixes.

* Update the Warp link.
2025-09-24 02:37:59 +08:00
Yudong Jin
44effb07e6 Bug fixes and improvements (#1813)
* Sync zh and zh-hant version.

* Add the Warp sponsor banner.

* Update README with acknowledgments and Warp recommendation

Added acknowledgments and a recommendation for the Warp terminal application.

* Update README.md

* Update links in README.md to use HTTPS

* Sync zh and zh-hant versions.

* Add special thanks for Warp spnsorship.

* Use official warp image link.
2025-09-23 20:44:38 +08:00
Siz Long
790a6d17e1 Update Q&A of hash_table and time_complexity Chapter (#1760)
* Update summary.md

@Richard-Zhao93 的回答非常好,同时觉得"如果在开头能了解到这部分s,对初学者来说,可能更容易接受这些陌生的概念。"的建议很有道理

* Update QA of time_complexity

* Enhance explanation of hash tables vs arrays

Clarify the advantages of hash tables over arrays for key-value mapping.

* Update summary.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2025-09-20 19:52:59 +08:00
sunshinesDL
a69b5ef93b Update hash_map.md (#1802)
* Update hash_map.md

对目标句子的表达略微修改,使得前后句子的语义更加一致。

* Fix wording for bucket index calculation

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2025-09-20 19:26:04 +08:00
sunshinesDL
218e21e800 Update stack.md (#1788)
* Update stack.md

K大好,小白建议在这句话前面增加一个条件 -- "每次只能移动一个盘子",如此不仅可以对应后面的 `将上面的盘子**依次**移走`,从而避免了 "可以将上面的盘子一次移走" 的歧义;而且对应了每次移除一个元素的出栈逻辑。

* Refine explanation of stack data structure

Corrected phrasing for clarity in stack explanation.

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2025-09-20 19:18:35 +08:00
PXG-XPG
3709a97ca7 Update dp_solution_pipeline.md (#1806)
错别字
2025-09-11 01:53:37 +08:00
Yudong Jin
7b320e14fe Sync zh and zh-hant versions (#1801)
* Sync zh and zh-hant versions.

* Unifying "数据体量" -> "数据规模".
2025-08-28 04:51:02 +08:00
MetaSky
803c0e09c7 code: update zig 0.14.1 for the chapter of array_and_linkedlist and computational_complexity (#1787)
* update zig array list chapter

* update not need change codes.

* fix some pr issues and update time space chapter
2025-08-06 02:33:00 +08:00
sunshinesDL
5c085b5592 Update performance_evaluation.md (#1770)
* Update performance_evaluation.md

**修改内容:**
把本节使用的 “输入数据大小” 统一修改为 “输入数据规模”。

**修改原因:**
今天在分析一个函数的复杂度时回看本节,发现这处表述好像存在歧义。阅读本节内容可知,复杂度分析实际是分析算法的运行时间和空间占用与数据规模的关系。 从字面理解,“输入数据的大小” 更像指输入数据的数值大小,而非数据规模。虽然多数场景下,输入数据的数值大小可以通过迭代/递归反映数据规模,但在个别场景下并非如此,如 5.1.2 节 "基于链表实现的栈" 中的 `to_list() `函数:
```python
 def to_list(self) -> list[int]:
        """转化为列表用于打印"""
        arr = []
        node = self._peek
        while node:
            arr.append(node.val)
            node = node.next
        arr.reverse()
        return arr
```
该函数无形参,其时间复杂度实际指,函数运行时间随着栈中数据数量的增加而呈现的增长趋势,而非随栈中数据数值大小的增加呈现的增长趋势。 因此,为规避歧义,小白提议将本节的“输入数据大小” 改为 “输入数据规模”。

然而,一百个读者有一百个哈姆雷特,或许其他读者读到这里未感觉歧义,且本章后续章节还有多处使用这一表述,若本节修改可能后面也需与其保持统一。或许也可以在本章2.1节插入一个Tip约定这一表述的实际意义。考虑不周,欢迎 K大及评阅大佬指正!

* Update performance_evaluation.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2025-07-20 19:56:15 +08:00
sunshinesDL
ee4d27dc17 Update time_complexity.md (#1772)
* Update time_complexity.md

对于多项式函数 c * f(n), 系数 c 好像不能称为常数项,遂查阅《算法导论 第三版》相关章节,在其 26 页使用了常量因子这一表述,该表述好像晦涩了些,小白提议这里将 ”常数项“ 改为 ”常数“。 
欢迎 K大及评阅大佬指正!

* Update time_complexity.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2025-07-10 07:08:44 +08:00
Yudong Jin
e8dc4736a2 Bug fixes and improvements. (#1780)
* Fix the "尾递归优化" to "递归深度优化" in quick_sort.

* Update landing pages.

* Sync zh and zh-hant versions.

* Sync zh and zh-hant versions.
2025-07-10 06:32:25 +08:00
sunshinesDL
6a4d62449c Update max_product_cutting_problem.md (#1758)
* Update max_product_cutting_problem.md

本节结尾的正确性证明中,

"使用反证法,只分析 n >= 3 的情况。"

这句是否应该改为 “只分析 n >= 4 的情况”,因为 n == 3 时,由于题目要求至少将 n 切分为两个正整数,所以此时应该切分为 1 * 2 ,切分方案里是包含 1 的 😁;
此外,对于这句描述:

“假设最优切分方案中存在 >= 4 的因子 x ,那么一定可以将其继续划分为 2(x-2) ,从而获得更大的乘积。”

最后半句改为“从而获得更大或可替代的乘积”是否更好,因为当切分方案中存在 4 作为因子时,将其划分为 2 * 2,乘积相对划分前是相等的。不过这处改动不影响“所有因子 <= 3” 的结论,因为因子 4 是可以被替代的。

* Update max_product_cutting_problem.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2025-06-12 21:10:15 +08:00
Dr.XYZ
ceec0eaa3a Specify currency unit in the "Price" row of the storage compar… (#1755)
* Specify currency unit as CNY in the "Price" row of the storage comparison table

* Revert changes to the English version

* Change currency unit to USD

* fix

* fix space

* Update ram_and_cache.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2025-06-12 20:57:47 +08:00
Yudong Jin
db64108e5d Bug fixes (#1766)
* Sync zh and zh-hant versions.

* Bug fixes.
2025-06-12 20:45:41 +08:00
Seren
e79a56f540 Update Zig example code (#1737) 2025-05-17 17:15:30 +08:00
Yudong Jin
f9d37e0d16 Update en/README. Bug fixes. (#1742)
* Fix graph_operations.md

* Update README

* Sync zh and zh-hant versions.
2025-04-27 16:56:24 +08:00
Yudong Jin
d976116292 Bug fixes and improvements (#1735)
* Fix the definition of "complete binary tree" in binary_tree.md

* Update en/README.md
2025-04-15 16:57:31 +08:00
Yudong Jin
8e38c61455 Bug fixes and improvements (#1732)
* Bug fixes

* Sync zh and zh-hant versions.

* "入列列" -> "入佇列"

* Fix hello_algo_mindmap.png
2025-04-10 19:21:52 +08:00
Sizhe Fan
3177d35eb2 Update the description of time and space complexity of fractional_knapsack problem. (#1688)
* 优化分数背包的部分复杂度描述,使其更加严谨

* Update fractional_knapsack_problem.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2025-03-20 19:46:17 +08:00
Peng Chen
82fa8cb222 Fix the typo in backtracking/summary.md (#1673) 2025-03-09 06:36:17 +08:00
Yudong Jin
ac0da11157 Bug fixes and improvements (#1627)
* Update Copyright 2024 to 2025.

* Fix the flex of .profile-cell for mobile devices.

* Update performance_evaluation.md

* 抛出 -> 给出

* Sync zh and zh-hant version.

* Improve the landing page of the English version.

* Bug fixes

* Fix readme-typing-svg

* Update readme-typing-svg

* Bug fixes

* sync zh and zh-hant versions.
2025-01-21 20:00:58 +08:00
KawaiiAsh
4db90555a7 Update binary_tree.md (#1618)
* Update binary_tree.md

* Update binary_tree.md

Thank you for the fix!

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2025-01-21 19:29:09 +08:00
Peter Chen; Kohan Chen
18027ee26c add notation of m and n in analysis of complexity (#1621)
* fix: notation of m and n in analysis of complexity

As title, complexity variable is not defined previously.

* Update dp_solution_pipeline.md

* Update dp_solution_pipeline.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2025-01-21 19:18:03 +08:00
llql1211
98daefa67a Update heap_sort.md (#1626) 2025-01-21 18:51:12 +08:00
Yudong Jin
2a955f937c Bug fixes and improvements (#1602)
* Fix the search panel on mobile devices.

* Fix the search panel for mobile devices.

* Update about_the_book.md
2025-01-02 21:50:42 +08:00
Yudong Jin
dad0a3fd95 Prepare 1.2.0 release (#1585)
* Sync zh and zh-hant versions

* Update the list of contributors.

* Update time_complexity_simple_example.png

* Reduce size of the RGBA images for zh-hant version.

* Sync the zh-hant version of terminology.md

* Prepare 1.2.0 release

* Update the contributors list.
2024-12-06 09:03:43 +08:00
Yudong Jin
abf1f115bf Bug fixes and improvements (#1581)
* A bug fixes

* Sync zh and zh-hant versions.

* Fix a question in chapter_array_and_linkedlist/summary.md

* Optimize a definition in what_is_dsa.md

* Fix the Contributing guidelines for Chinese-to-English.

* Add a q&a in chapter_array_and_linkedlist/summary.md

* Sync zh and zh-hant versions.

* Update .gitignore

* Sync zh and zh-hant versions.
2024-12-04 17:58:28 +08:00
YuZou
ca774eefbf Update time_complexity.md (#1578)
* Bug fixes and improvements (#1577)
 * correct the implement of exp_recur function and remove +1 operation from the function to simulate the cell division process

* Update time_complexity.rs

* Update time_complexity.md

---------

Co-authored-by: zouy26 <zouy26@chinaunicom.cn>
Co-authored-by: Yudong Jin <krahets@163.com>
2024-12-04 17:36:11 +08:00
Yudong Jin
2a9db6d039 Bug fixes and improvements (#1572)
* Sync zh and zh-hant versions.

* Remove the polyfill.io link from mkdocs.yml

* Update contributors' info for code reviewers and en/zh-hant versions reviewers.

* Fix graph.md

* Update avatars for English version reviewers.

* Sync zh and zh-hant versions.

* Fix two_sum_brute_force.png

* Sync zh and zh-hant versions.
Optimize structrue of index.html.

* Format index.html
2024-11-25 19:21:11 +08:00
Anurag Pandey
01a5f7b09f Improved HTML Structure for Better Accessibility and Maintainability (#1434)
* Improved HTML Structure for Better Accessibility and Maintainability

Commit Description:

    Semantic Sectioning and Class Names:
        Updated class names to be more descriptive.
        Ensured better readability and maintainability.

    Alt Text for Images:
        Added alt attributes to all <img> tags to improve accessibility.

    SVG Elements:
        Added appropriate role attributes to SVG elements.

    External Links:
        Updated external links to open in a new tab using target="_blank".
        Added rel="noopener noreferrer" for security reasons.

    CSS Separation:
        Inlined styles for demonstration purposes but recommended moving them to a separate stylesheet for better separation of concerns.

* Update index.html

* Update index.html

* Update index.html

* Update index.html

* Update index.html

* Update index.html

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-11-25 19:15:06 +08:00
Yudong Jin
73eab4c0ec Update reviewer profiles (#1547)
* Sync zh and zh-hant versions.

* Remove the polyfill.io link from mkdocs.yml

* Update contributors' info for code reviewers and en/zh-hant versions reviewers.

* Fix graph.md

* Update avatars for English version reviewers.

* Sync zh and zh-hant versions.
2024-11-07 20:56:16 +08:00
hpstory
b3b10f2300 fix(csharp): priority queue comparer initialization (#1542) 2024-10-31 21:25:32 +08:00
Akshit
0c60037e56 Update avl_tree.md (#1524)
Syntax for avl trees updated
2024-10-10 18:23:54 +08:00
ZhongGuanbin
dedb4aaced Update linked_list.md (#1521)
双向链表的Dart代码可能存在语法错误,因为前驱节点和后继节点可能为空,所以需要添加问号,否则无法通过空安全检查
2024-09-28 09:13:18 +08:00
Seven Du
f4baa7d9de add a period at the end (#1478) 2024-08-06 15:05:30 +08:00
Seven Du
fc7efa28a7 remove extra space (#1477)
* remove extra space

* Update max_capacity_problem.md

* Update algorithms_are_everywhere.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-08-06 15:04:53 +08:00
溯渺
0bff488383 Update binary_tree.md (#1454)
* Update binary_tree.md

关于完全二叉树严谨性补充:完美二叉树是一棵特殊的完全二叉树,完全二叉树的最底层节点可以是满的。

* Update binary_tree.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-08-01 17:32:49 +08:00
Yudong Jin
c9041c5c5e Bug fixes and improvements (#1472)
* preorder, inorder, postorder -> pre-order, in-order, post-order

* Bug fixes

* Bug fixes

* Update what_is_dsa.md

* Sync zh and zh-hant versions

* Sync zh and zh-hant versions.

* Update performance_evaluation.md and time_complexity.md

* Add @khoaxuantu to the landing page.

* Sync zh and zh-hant versions

* Add @ khoaxuantu to the landing page of zh-hant and en versions.

* Sync zh and zh-hant versions.

* Small improvements

* @issue :  #1450 (#1453)

Fix writing "obsecure" to "obscure"

Co-authored-by: Gaya <kheliligaya@gmail.com>

* Update the definition of "adaptive sorting".

* Update n_queens_problem.md

* Sync zh, zh-hant, and en versions.

---------

Co-authored-by: Gaya-Khelili <50716339+Gaya-Khelili@users.noreply.github.com>
Co-authored-by: Gaya <kheliligaya@gmail.com>
2024-07-30 16:56:59 +08:00
Rui
27d59f65a6 fix invalid code comment (#1405)
* Remove invalid comment

* Update time_complexity.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-06-28 19:20:41 +08:00
Yudong Jin
3f4220de81 Bug fixes and improvements (#1380)
* preorder, inorder, postorder -> pre-order, in-order, post-order

* Bug fixes

* Bug fixes

* Update what_is_dsa.md

* Sync zh and zh-hant versions

* Sync zh and zh-hant versions.

* Update performance_evaluation.md and time_complexity.md

* Add @khoaxuantu to the landing page.

* Sync zh and zh-hant versions

* Add @ khoaxuantu to the landing page of zh-hant and en versions.
2024-05-31 16:39:06 +08:00
khoaxuantu
a704c0d7f2 feat: finalize ruby code transpilation (#1379) 2024-05-31 12:30:55 +08:00
khoaxuantu
aa818945f0 feat: Add Ruby code - chapter "Backtracking" (#1373)
* [feat] add ruby code - chapter backtracking

* feat: add ruby code block - chapter backtracking
2024-05-24 15:41:40 +08:00