164 Commits
Author SHA1 Message Date
Lukas 61ad6ed7f6 Correct C# knapsack ordering, repeated keys and heap output (#1998)
Co-authored-by: Lukas <[email protected]>
2026-11-24 01:27:02 +08:00
Yudong JinandClaude Opus 5.5 ded7ddc635 Revert the runnable-snippets batches to the #2033 state (#2038)
Reverts #2034, #2035, #2036 and #2037. The work will return in a single
reviewed PR that is completed before it merges. The tree equals 8c96e2f30
(#2033).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 06:45:32 +08:00
Yudong JinandClaude Opus 5.5 b113cb425a Cite the shared TreeNode for the AVL node and the C binary tree node (#2037)
Batch 3b of the runnable-snippets plan. avl_tree_node now cites each
language's shared TreeNode in all 13 languages, and the C tree_node_class
shares the same region. Rust gets an import region; Java, C#, Swift and
Kotlin skip their serialization helpers with an adjacent region.

The shared nodes gain reviewed field comments in C++ and Rust, aligned
comments in Java, Swift and Kotlin, and a spacing fix in JavaScript. The
AVL section adds one sentence saying the shared node class already has
height. Four ru Rust files whose multi-line statements had collapsed into
literal \n now compile again. en, ja, ko and zh-hant are regenerated; ru
is synced by hand.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 05:51:36 +08:00
Yudong JinandClaude Opus 5.5 bcd86fc1ed Cite demo-source regions for heap operations and the linked-list node classes (#2036)
Batch 3a of the runnable-snippets plan. heap_operations now cites the heap
demos in Python, C++, Java, C#, Go, Swift, Rust and Kotlin; the demos call
the library directly instead of push/pop helpers and print each popped value.
list_node_class cites each language's shared ListNode (Swift stays literal)
and doubly_list_node_class cites linkedlist_deque (Go stays literal).

Node comments adopt reviewed source wording, Rust and Swift get import
regions, the Ruby typo 前躯 becomes 前驱, and the TypeScript doubly node
fields become nullable. en, ja, ko and zh-hant are regenerated; ru is
synced by hand.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 05:23:41 +08:00
Yudong JinandClaude Opus 5.5 eeb8a3b790 Cite demo-source regions from the remaining A-class snippets (batch 2) (#2035)
Migrate init_array, hash_map_operations, hash_map_traversal,
queue_operations, deque_operations and insert_remove_node: zh and ru
demo sources gain region markers and the snippets' comments, en, ja and
ko are regenerated from reviewed translations, zh-hant via OpenCC. 70
blocks become region references; builtin_hash and five blocks without
reviewed translations stay literal.

The Java, Kotlin and Rust deque demos follow the book's order, and a few
demo comments and typos are aligned with the snippets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 04:23:45 +08:00
Yudong JinandClaude Opus 5.5 849b6a95b9 Cite demo-source regions from doc snippets (pilot) (#2034)
Doc snippets for init_linked_list, init_binary_tree, stack_operations and
five list.md entries now reference marked regions of the demo programs
instead of copying code, so the book shows code that is compiled and run.

- Mark regions in the zh demo files and add the snippet comments that the
  demos lacked, reusing texts that already have reviewed translations.
- Sync ru by hand, regenerate en/ja/ko from the reviewed dictionaries and
  derive zh-hant with OpenCC.
- Convert 97 snippet blocks in six editions to [file]{..}-[region]{..}
  references; init_list and the Rust stack block stay literal until their
  comments have reviewed translations.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-16 03:36:04 +08:00
Yudong Jin 620abe42f3 fix: sync array, deque, and printing fixes across translations (#1973)
Synchronize the fixes from #1936, #1824, and #1961 across translated editions and normalize C# and Dart formatting. Move Java CI to Ubuntu 24.04 so its Java 11/17 checks can run.
2026-10-11 00:58:16 +08:00
KingCrimsonJY 5b279d48b3 fix: handle single-node pops in linked-list deques (#1824) 2026-10-10 19:18:20 +08:00
Yudong Jin 28c1e74c1d Add multilingual exercise code (#1959)
Replace the exercise pages' Python-only snippets with source-backed implementations for the 13 visible programming languages, and localize reader-facing comments by site language. Zig remains out of scope.

Approval bypass: repository protection requires one approval but does not enforce it for administrators. All 68 completed checks succeeded; four non-required Java jobs remained queued on the existing ubuntu-20.04 workflow, with no failed checks.
2026-08-18 04:57:57 +08:00
Yudong Jin bf86c39b6c Fix multilingual content typos (#1958) 2026-08-18 03:08:23 +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
Flamingo 57cf6b1ea6 fix some typos (#1540) 2024-10-31 21:26:28 +08:00
hpstory b3b10f2300 fix(csharp): priority queue comparer initialization (#1542) 2024-10-31 21:25:32 +08:00
rongyiandYudong Jin 21be3fdaf8 [Rust] Normalize mid calculation in case overflow (#1363)
* Normalize mid calculate in case overflow

* Change ALL language

* Update merge_sort.py

* Update merge_sort.zig

* Update binary_search_tree.zig

* Update binary_search_recur.py

---------

Co-authored-by: Yudong Jin <[email protected]>
2024-05-18 18:19:19 +08:00
Yudong Jin cfc273783b feat: Add glossary and description for "哈希集合" (#1310) 2024-04-28 22:00:25 +08:00
Yudong Jin 034ee65e9a Fix bugs and harmonize the code comments (#1199)
* Fix the comment in array_deque.go

* Fix the comment in bucket_sort.c

* Translate the Java code comments to Chinese

* Bug fixes

* 二分查找 -> 二分搜尋

* Harmonize comments in `utils` between multiple programming languages
2024-03-31 03:06:41 +08:00
Yudong Jin 3ea91bda99 fix: Use int instead of float for the example code of log time complexity (#1164)
* Use int instead of float for the example code of log time complexity

* Bug fixes

* Bug fixes
2024-03-23 02:17:48 +08:00
Nan Lei 300a781fab Update code comment of quadratic in time_complexity (#1155) 2024-03-19 02:28:16 +08:00
Yudong Jin 7f43f92ae9 Bug fixes and improvements (#1152)
* Update avl_tree.md

* Remove the empty space

* Simplify the heading of the paperbook chapter

* Update hash_map_open_addressing.go to the latest version

* Improvements
2024-03-18 13:34:02 +08:00
Yudong Jin 9769e14017 Fix the median_three mehod for quick sort (#1134)
* Add the section of terminologies.

* fix format

* Fix median_three function for quick sort

* Delete docs/chapter_appendix/terminologies.md

* Update quick_sort.ts

* Update quick_sort.rs

* Update quick_sort.js
2024-03-15 01:06:59 +08:00
Yudong Jin 01c67781fa Bug fixes and improvements (#1133)
* Bug fixes

* Update the figure of the JD link

* Unify the code comments of insertion_sort
2024-03-14 20:01:16 +08:00
hpstory 85f0071c2a fix(csharp): while loop II comment (#1052) 2024-01-17 15:26:41 +08:00
Yudong Jin f6976978dd Prepare 1.0.0 release (#1044)
* Update the book with the thrid revised edition

* Fix a typo

* Update the contributors' information

* Update the mindmap

* Update the version number
2024-01-14 03:16:20 +08:00
Yudong Jin ddd375af20 feat: Add visualizing code blocks based on the pythontutor (#1029)
* Update copyright

* Update the Python code

* Fix the code comments in ArrayBinaryTree

* Fix the code comments in ArrayBinaryTree

* Roll back time_comlexity.py

* Add the visualizing code(pythontutor) blocks to the chapter complexity, data structure, array and linked list, stack and queue, hash table, and backtracking

* Fix the code comments
2024-01-07 04:04:01 +08:00
Yudong Jin f68bbb0d59 Update the book based on the revised second edition (#1014)
* Revised the book

* Update the book with the second revised edition

* Revise base on the manuscript of the first edition
2023-12-28 18:06:09 +08:00
Yudong Jin e720aa2d24 feat: Revised the book (#978)
* Sync recent changes to the revised Word.

* Revised the preface chapter

* Revised the introduction chapter

* Revised the computation complexity chapter

* Revised the chapter data structure

* Revised the chapter array and linked list

* Revised the chapter stack and queue

* Revised the chapter hashing

* Revised the chapter tree

* Revised the chapter heap

* Revised the chapter graph

* Revised the chapter searching

* Reivised the sorting chapter

* Revised the divide and conquer chapter

* Revised the chapter backtacking

* Revised the DP chapter

* Revised the greedy chapter

* Revised the appendix chapter

* Revised the preface chapter doubly

* Revised the figures
2023-12-02 06:21:34 +08:00
hpstoryandYudong Jin 56b20eff36 feat(csharp) .NET 8.0 code migration (#966)
* .net 8.0 migration

* update docs

* revert change

* revert change and update appendix docs

* remove static

* Update binary_search_insertion.cs

* Update binary_search_insertion.cs

* Update binary_search_edge.cs

* Update binary_search_insertion.cs

* Update binary_search_edge.cs

---------

Co-authored-by: Yudong Jin <[email protected]>
2023-11-26 23:18:44 +08:00
Yudong Jin fcbaf101a4 Several bug fixes and improvements (#945)
* Update Dockerfile for code debugging.

* Format Python code using Black.

* Improve dark theme by defining html classes for the figures, animations and cover images.

* Fix several glossary translation.

* Update a code comment.

* Fix climbing_stairs_backtrack: the pruning should not require the sorted choices list.

* Update the code of array and list traversal.

* Fix a rendering issue of README.md

* Update code of list traversal.

* Fix array_definition.png

* Update README.md

* Fix max_capacity_moving_short_board.png

* Fix array.dart

* Fix array.dart

* Fix array.dart

* Fix array.dart
2023-11-14 21:27:35 +08:00
krahets 5f3ad1ed3d A few bug fixes. 2023-11-03 22:48:43 +08:00
krahets 355cc3a6b1 Bug fixes to C code. 2023-11-01 05:14:22 +08:00
Yudong Jin e441ee4e35 Re-implement merge sort function. (#888) 2023-10-26 02:56:33 +08:00
Yudong Jin 7822bf9cd4 feat: add top_k.c and refactor top_k.js (#889)
* Add top_k.c based on my_heap.c

* Improve the implementation of top_k.js

* Add a comment to top_k
2023-10-26 02:54:19 +08:00
hpstory fb3ce050c1 feat(csharp): add .net building and testing workflow, solution file (#879) 2023-10-24 17:13:29 +08:00
krahets 5392afd44b fix several bugs 2023-10-17 23:45:31 +08:00
krahets 346c8451de Fix code naming style. 2023-10-15 21:18:09 +08:00
krahets a8c624fa5a Fix the code in min_path_sum 2023-10-14 03:25:11 +08:00
krahets fb552987f5 Update variable names in list and my_list 2023-10-09 18:20:42 +08:00
hpstory e03022d5fb fix: Polishing code format on linearLogRecur, convert String type to string (#841) 2023-10-08 07:33:30 -05:00
krahets 51dab9dd25 Update overrides directory structure. 2023-10-08 04:42:57 +08:00
hpstory f62256bee1 fix(csharp): Modify method name to PascalCase, simplify new expression (#840)
* Modify method name to PascalCase(array and linked list)

* Modify method name to PascalCase(backtracking)

* Modify method name to PascalCase(computational complexity)

* Modify method name to PascalCase(divide and conquer)

* Modify method name to PascalCase(dynamic programming)

* Modify method name to PascalCase(graph)

* Modify method name to PascalCase(greedy)

* Modify method name to PascalCase(hashing)

* Modify method name to PascalCase(heap)

* Modify method name to PascalCase(searching)

* Modify method name to PascalCase(sorting)

* Modify method name to PascalCase(stack and queue)

* Modify method name to PascalCase(tree)

* local check
2023-10-07 12:33:46 -05:00
krahets 4355f8d49f Several bug fixes. 2023-10-04 02:30:31 +08:00
krahets ff8e7ceec5 Several bug fixes. 2023-09-24 20:38:21 +08:00
hpstory 29c5ff4a8f feat(csharp): add forLoopRecur and new HashMapOpenAddressing (#783) 2023-09-23 14:15:23 -05:00
krahets cb9c14f5ff fix build_tree, binary_search_tree.cs
fix two figures
2023-09-15 02:08:09 +08:00
krahets d190dbf3c1 Several enhancements and fixes 2023-09-14 03:36:31 +08:00
malone6 9b8625d741 Sync the while loop in iteration.cs with other languages (#746) 2023-09-13 03:06:40 +08:00
krahets f71b2a40da fix preorder_traversal_iii_compact code 2023-09-09 00:51:00 +08:00
krahets dd72335235 Format C, C++, C#, Go, Java, Python, Rust code. 2023-09-02 23:54:38 +08:00
hpstoryandYudong Jin 8a0a8b80cf feat(csharp): fix binary_search_tree code (#712)
* feat(csharp): fix binary_search_tree code

* Update binary_search_tree.cs

---------

Co-authored-by: Yudong Jin <[email protected]>
2023-08-31 16:59:43 +08:00
krahets a47a974a6a fix climbing_stairs_constraint_dp code 2023-08-31 02:31:58 +08:00