1032 Commits

Author SHA1 Message Date
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
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
db64108e5d Bug fixes (#1766)
* Sync zh and zh-hant versions.

* Bug fixes.
2025-06-12 20:45:41 +08:00
e79a56f540 Update Zig example code (#1737) 2025-05-17 17:15:30 +08:00
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
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
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
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
82fa8cb222 Fix the typo in backtracking/summary.md (#1673) 2025-03-09 06:36:17 +08:00
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
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
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
98daefa67a Update heap_sort.md (#1626) 2025-01-21 18:51:12 +08:00
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
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
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
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
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
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
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
b3b10f2300 fix(csharp): priority queue comparer initialization (#1542) 2024-10-31 21:25:32 +08:00
0c60037e56 Update avl_tree.md (#1524)
Syntax for avl trees updated
2024-10-10 18:23:54 +08:00
dedb4aaced Update linked_list.md (#1521)
双向链表的Dart代码可能存在语法错误,因为前驱节点和后继节点可能为空,所以需要添加问号,否则无法通过空安全检查
2024-09-28 09:13:18 +08:00
f4baa7d9de add a period at the end (#1478) 2024-08-06 15:05:30 +08:00
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
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
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
a704c0d7f2 feat: finalize ruby code transpilation (#1379) 2024-05-31 12:30:55 +08:00
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
9afbc9eda5 [Rust] Use arrays instead of vectors in Chapter 4.1 Array (#1357)
* [Rust] Use array in chapter 4.1

* docs: update comments

* docs: update comments

* docs: update comments

* fix: update slices

* docs: update comments
2024-05-15 18:31:48 +08:00
c4a7966882 Bug fixes and improvements (#1348)
* Add "reference" for EN version. Bug fixes.

* Unify the figure reference as "the figure below" and "the figure above".
Bug fixes.

* Format the EN markdown files.

* Replace "" with <u></u> for EN version and bug fixes

* Fix biary_tree_dfs.png

* Fix biary_tree_dfs.png

* Fix zh-hant/biary_tree_dfs.png

* Fix heap_sort_step1.png

* Sync zh and zh-hant versions.

* Bug fixes

* Fix EN figures

* Bug fixes

* Fix the figure labels for EN version
2024-05-06 14:44:48 +08:00
9e4017b3fb Update heap.md (#1344) 2024-05-06 05:32:23 +08:00
870e3e5cb2 Bug fixes and improvements (#1318)
* Sync zh and zh-hant versions

* Update en/README.md

* Add a Q&A for chapter of introduction

* Update the callout headers

* Sync zh ang zh-hant versions

* Bug fixes
2024-04-30 15:52:05 +08:00
75873f0a05 fix(typo): Update linked_list.md (#1307)
它表现出先进后出的特性,对应栈;它表现出先进先出的特性,对应队列。
适当修改为“它表现的特性为先进后出”和“它表现的特性为先进先出”。
因为原本的语句第一次阅读出现“出先进后”的错误断句
2024-04-28 22:02:39 +08:00
cfc273783b feat: Add glossary and description for "哈希集合" (#1310) 2024-04-28 22:00:25 +08:00
f616dac7da Bug fixes and improvements (#1298)
* Fix is_empty() implementation in the stack and queue chapter

* Update en/CONTRIBUTING.md

* Remove "剩余" from the state definition of knapsack problem

* Sync zh and zh-hant versions

* Update the stylesheets of code tabs

* Fix quick_sort.rb

* Fix TS code

* Update chapter_paperbook

* Upload the manuscript of 0.1 section

* Fix binary_tree_dfs.rb

* Bug fixes

* Update README

* Update README

* Update README

* Update README.md

* Update README

* Sync zh and zh-hant versions

* Bug fixes
2024-04-22 02:26:32 +08:00
74f1a63e8c feat: add ruby code blocks - chapter tree (#1293) 2024-04-19 23:42:20 +08:00
a587b01c4d feat(appendix): TypeScript installation (#1279)
* feat(appendix): TypeScript installation

* Update installation.md

* Update installation.md

* Update installation.md

* Update installation.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-04-18 01:22:30 +08:00
be9931c8a1 feat: Add Ruby code - chapter "Hashing" (#1276)
* feat: add ruby code - chapter hashing

* feat: add ruby code blocks - chapter hashing

* fix: comments
2024-04-15 16:20:26 +08:00
d484b08c15 Prepare 1.1.0 release (#1274)
* Update bucket_sort.c

* Fix the comments in quick_sort.c

* Update the announce badge

* Sync zh and zh-hant versions

* Update contributors list.

* Sync zh and zh-hant versions.

* Sync zh and zh-hant versions.

* Update the contributors list

* Update the version number
2024-04-14 20:46:20 +08:00
4d9bbe72e1 Improve the consistency between code and comments in Kotlin (#1268)
* style(kotlin): Make code and comments consistent.

* style(kotlin): convert comment location.

* style(c): Add missing comment.

* style(kotlin): Remove redundant semicolon, parenthesis and brace

* style(kotlin): Put constants inside the function.

* style(kotlin): fix unnecessary indentation.

* style(swift): Add missing comment.

* style(kotlin): Add missing comment.

* style(kotlin): Remove redundant comment.

* style(kotlin): Add missing comment.

* Update linked_list.kt

* style(csharp,js,ts): Add missing comment.

* style(kotlin): Remove empty lines.

* Update list.cs

* Update list.js

* Update list.ts

* roll back to commit 1

* style(cs,js,ts): Add missing comment in docfile.

* style(kotlin): Use normal element swapping instead of scope functions.
2024-04-13 20:09:39 +08:00
b2f0d4603d Many bug fixes and improvements (#1270)
* Add Ruby and Kotlin icons
Add the avatar of @curtishd

* Update README

* Synchronize zh-hant and zh versions.

* Translate the pythontutor blocks to traditional Chinese

* Fix en/mkdocs.yml

* Update the landing page of the en version.

* Fix the Dockerfile

* Refine the en landingpage

* Fix en landing page

* Reset the README.md
2024-04-11 20:18:19 +08:00
ab536479d0 feat: add correct comment for RUBY (#1247)
* feat: add correct comment for RUBY

* fix: use correct multi-line comments for RUBY
2024-04-10 18:11:19 +08:00
78f71eeacb Bug fixes and improvements (#1252)
* Bug fixes

* Fix the landing page of zh-hant version

* Bug fixes and add an Q&A for chapter_data_structure

* Update the mindmap for zh-hant version
2024-04-09 19:55:59 +08:00
e4784ba939 feat: add ruby code blocks - chapter stack and queue (#1234) 2024-04-07 18:58:56 +08:00
bd54594a90 feat: add ruby code block - chapter data structure (#1227) 2024-04-07 01:44:18 +08:00
4fadad50ba fix: Some Ruby code (#1231)
* fix: ruby code block - chapter computational complexity

* fix: ruby code - chapter array and linkedlist
2024-04-07 01:39:45 +08:00
0503e740ad Update symbol format in LaTex of number encoding section (#1193) 2024-04-07 01:33:42 +08:00