24 Commits
Author SHA1 Message Date
IainandIain ee0cba022c Fix root deletion in C and Rust binary search trees (#2020)
Co-authored-by: Iain <[email protected]>
2026-11-24 01:26:08 +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 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
rongyi 68a61f23d5 make dfs same as c/c++ and other small improvement (#1543) 2024-10-31 21:24:56 +08:00
rongyi ef3010bd77 idomatic structure rust code, no include macro (#1528) 2024-10-23 18:49:47 +08:00
rongyi f901a31bae fix(Rust): no need to clone in hash put fn (#1226)
* no need to clone in hash put fn

* fmt rust code

* make code more readable

* Change vec append to extend, more friendly to rookie rust dev

* drop comment
2024-04-07 14:46:21 +08:00
rongyiandYudong Jin 7b1094318b cargo fmt rust code (#1131)
* cargo fmt code

* Add empty line to seperate unrelated comments

* Fix review

* Update bubble_sort.rs

* Update merge_sort.rs

---------

Co-authored-by: Yudong Jin <[email protected]>
2024-03-16 02:13:41 +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
易春风 b115a2b895 Fix the issue of discuss comment 7919887 (#996) 2023-12-23 23:20:26 +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
krahets 5385057993 Replace "结点" with "节点". 2023-10-27 23:24:13 +08:00
Night Cruising 3af00d00d7 feat: add rust codes for chapter computational complexity (#714) 2023-09-02 16:08:52 +08:00
krahets 628d8a516b fix binary_search_tree code 2023-08-31 02:31:31 +08:00
krahets 2626de8d0b Polish the chapter
introduction, computational complexity.
2023-08-20 14:51:39 +08:00
Night CruisingandYudong Jin 06006c58a2 feat: add rust codes for array binary tree (#654)
* feat: add rust codes for array binary tree

* update tree_node.rs

* update: add implementation of vec_to_tree and tree_to_vec

* update tree_node.rs

* Update tree_node.rs

---------

Co-authored-by: Yudong Jin <[email protected]>
2023-07-26 09:15:58 +08:00
Night CruisingandYudong Jin fdbe275fc9 fix: check the rust codes and fix them (#653)
* fix: check the rust codes and fix it

* Update binary_tree_bfs.rs

---------

Co-authored-by: Yudong Jin <[email protected]>
2023-07-24 22:27:26 +08:00
Night CruisingandYudong Jin f5ea4fa1c6 feat: add rust codes for avl tree (#605)
* feat: add rust codes for avl tree

* fix a wrong usage of borrow method of RefCell

* Update avl_tree.rs

* fix comment indentation and field define of TreeNode

---------

Co-authored-by: Yudong Jin <[email protected]>
2023-07-16 01:32:43 +08:00
xBLACKICExandYudong Jin abecea9ab6 ✨feat(rust/tree): add binary_search_tree (#481)
* ✨ feat(rust/tree): add binary_tree_dfs

* ✨ feat(rust/tree): add binary_tree_bfs

* 🐞 fix(rust/tree): can't list to any kind of tree

* ✨feat(rust/tree): add binary_search_tree

* Update binary_search_tree.rs

* 🐞 fix(rust/tree): corret writing mistakes

* 🦄 refactor(rust/tree): remove get_next_node() function

* Update binary_search_tree.rs

---------

Co-authored-by: Yudong Jin <[email protected]>
2023-05-23 15:42:08 +08:00
xBLACKICEx 9c2e5e2831 ✨ feat(rust/tree): add binary_tree_bfs, binary_tree_dfs, (#450)
* ✨ feat(rust/tree): add binary_tree_dfs

* ✨ feat(rust/tree): add binary_tree_bfs

* 🐞 fix(rust/tree): can't list to any kind of tree
2023-04-21 14:58:46 +08:00
Yudong Jin 1c8b7ef559 refactor: Replace 结点 with 节点 (#452)
* Replace 结点 with 节点
Update the footnotes in the figures

* Update mindmap

* Reduce the size of the mindmap.png
2023-04-09 04:32:17 +08:00
krahets 3f4e32b2b0 Polish the chapter of graph, hashing, appendix 2023-04-09 03:09:06 +08:00
xBLACKICEx 590b532606 ✨ feat(rust/tree): add binary_tree (#398)
* ✨ feat(rust/hashing): add array_hash_map

* 📃 docs(rust/hashing): correct comments

* ✨ feat(rust/include): add tree_node

* ✨ feat(rust/include): add print_tree

* ✨ feat(rust/tree): add binary_tree

* docs(rust/tree): correct comments

* 📃 docs(rust/tree): correct comments
2023-03-07 23:46:28 +08:00