143 Commits

Author SHA1 Message Date
7751ea1256 update rust heap (#1761) 2025-06-12 20:47:47 +08:00
bd03b8c66e tiny fix, more readable rust 2025-03-10 17:22:06 +08:00
00738f5bb4 idomatic rust (#1652)
* idomatic rust

* Update linkedlist queue/deque
2025-02-10 10:40:29 +08:00
e36453ac25 replace std::mem::replace with std::mem::take according to clippy sugguestion (#1611)
Co-authored-by: frost.wong <happyhackerwqc@foxmail.com>
2025-01-26 06:09:26 +08:00
7503a33e8c fix rust linked list (#1609) 2025-01-14 02:58:17 +08:00
68a61f23d5 make dfs same as c/c++ and other small improvement (#1543) 2024-10-31 21:24:56 +08:00
ef3010bd77 idomatic structure rust code, no include macro (#1528) 2024-10-23 18:49:47 +08:00
7a345fc66b Idiomatic rust (#1505) 2024-09-12 17:38:16 +08:00
2cd2a94ce6 fix(backtracking): minor mistake in Rust code for subset_sum_ii (#1487)
* fix(backtracking): minor mistake in Rust code for subset_sum_ii

* Update subset_sum_ii.rs

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-08-26 10:12:47 +08:00
8a6ce26f6a idiomatic rust (#1485)
* idomatic rust

* More idiomatic rust

* make rust code more idiomatic

* update
2024-08-23 02:33:47 +08:00
Rui
2758e06374 remove unnecessary type conversions (#1411) 2024-07-14 18:36:00 +08:00
017b95f003 Make rust more idomatic (#1386) 2024-06-13 15:19:21 +08:00
63bcdb798a [Rust] make rust part more idomatic and fix panic of backtrack template (#1370)
* Drop unused variable

* Idiomatic rust

* Fix panic template
2024-05-24 16:21:17 +08:00
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 <krahets@163.com>
2024-05-18 18:19:19 +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
840692acce Idiomatic rust (#1364) 2024-05-15 18:16:55 +08:00
063a41fa7f [Rust] No need to use mut iter (#1356)
* No need to use mut iter

* Update iter
2024-05-12 14:49:25 +08:00
ebff1cce9f Stick with swap (#1352) 2024-05-11 17:59:44 +08:00
7a96f6a743 Fix panic when array's len is less than 2 (#1353) 2024-05-11 17:59:11 +08:00
56a165bf98 cargo fmt code (#1349) 2024-05-08 18:37:38 +08:00
cfc273783b feat: Add glossary and description for "哈希集合" (#1310) 2024-04-28 22:00:25 +08:00
a88c7b9862 Change remove to pop (#1309) 2024-04-28 20:47:03 +08:00
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
b3f100aff1 Bug fixes and improvements (#1205)
* Add Ruby code blocks to documents

* Remove Ruby code from en/docs

* Remove "center-table" class in index.md

* Add "data-toc-label" to handle the latex heading during the build process

* Use normal JD link instead.

* Bug fixes
2024-04-01 19:37:00 +08:00
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
556af1624c No need to match expand pop, just return it (#1154) 2024-03-27 01:29:43 +08:00
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
300a781fab Update code comment of quadratic in time_complexity (#1155) 2024-03-19 02:28:16 +08:00
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
6f1ec66949 Fix rust compile warning and an obvious print error in array.rs (#1144)
* Fix rust compile warning and an obvious print error in array.rs

* Update LinkedList

1. drop unnessaray mut borrow
2. fmt code and make variable more readable

* follow convention of this repo

* Update list_node.rs

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-03-18 02:44:03 +08:00
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 <krahets@163.com>
2024-03-16 02:13:41 +08:00
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
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
d4d281cd67 Fix the issue of discussion 514 (#1064) 2024-01-27 19:42:19 +08:00
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
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
ad663615e6 Fix the issues of discusscomment 7949412 and 7985550 (#1027) 2024-01-06 14:47:32 +08:00
7ffef7e1d6 update the author info sjinzh -> codingonion (#1017)
* update author information

* Update index.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-01-02 01:25:37 +08:00
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
1ee0a7a7bf Fix the issue of discusscomment 7938404 (#1006) 2023-12-26 16:40:57 +08:00
b115a2b895 Fix the issue of discuss comment 7919887 (#996) 2023-12-23 23:20:26 +08:00
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
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
9baf4a1753 Use Vec.last() method to access the top item of stack. (#942)
* Use Vec.last() method to access the top item of stack.

* Use Vec.last() method to access the top item of stack.
2023-11-13 14:18:29 +08:00
c81d5e091b Unsize type must be greater than or equal to 0 (#931) 2023-11-09 17:21:09 +08:00
5f3ad1ed3d A few bug fixes. 2023-11-03 22:48:43 +08:00
355cc3a6b1 Bug fixes to C code. 2023-11-01 05:14:22 +08:00
5385057993 Replace "结点" with "节点". 2023-10-27 23:24:13 +08:00
3628b40f44 refactor: re-implement the rust codes of merge sort (#891) 2023-10-26 22:24:02 +08:00
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