Commit graph

138 commits

Author SHA1 Message Date
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)
Some checks failed
Rust / build (macos-latest) (push) Has been cancelled
Rust / build (ubuntu-latest) (push) Has been cancelled
Rust / build (windows-latest) (push) Has been cancelled
2024-10-23 18:49:47 +08:00
rongyi
7a345fc66b
Idiomatic rust (#1505) 2024-09-12 17:38:16 +08:00
Risun
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
rongyi
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
rongyi
017b95f003
Make rust more idomatic (#1386) 2024-06-13 15:19:21 +08:00
rongyi
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
rongyi
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
CarrotDLaw
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
rongyi
840692acce
Idiomatic rust (#1364) 2024-05-15 18:16:55 +08:00
rongyi
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
rongyi
ebff1cce9f
Stick with swap (#1352) 2024-05-11 17:59:44 +08:00
rongyi
7a96f6a743
Fix panic when array's len is less than 2 (#1353) 2024-05-11 17:59:11 +08:00
rongyi
56a165bf98
cargo fmt code (#1349) 2024-05-08 18:37:38 +08:00
Yudong Jin
cfc273783b
feat: Add glossary and description for "哈希集合" (#1310) 2024-04-28 22:00:25 +08:00
rongyi
a88c7b9862
Change remove to pop (#1309) 2024-04-28 20:47:03 +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
Yudong Jin
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
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
rongyi
556af1624c
No need to match expand pop, just return it (#1154) 2024-03-27 01:29:43 +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
rongyi
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
rongyi
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
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
易春风
d4d281cd67
Fix the issue of discussion 514 (#1064) 2024-01-27 19:42:19 +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
易春风
ad663615e6
Fix the issues of discusscomment 7949412 and 7985550 (#1027) 2024-01-06 14:47:32 +08:00
codingonion
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
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
易春风
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
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
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
易春风
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
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
krahets
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
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
krahets
5392afd44b fix several bugs 2023-10-17 23:45:31 +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
易春风
e8bf5879b0
fix: the rust variable should have a snake case name (#811) 2023-09-29 08:37:02 -05:00