Commit graph

1213 commits

Author SHA1 Message Date
砖吐筷筷
de20d32ed6
Merge bc0e32af57 into 894e3d536b 2024-11-25 00:43:05 -03:00
sslmj2020
894e3d536b
Update array_binary_tree.cpp (#1568)
Some checks failed
C++ / build (Release, clang, clang++, ubuntu-latest) (push) Failing after 16s
C++ / build (Release, gcc, g++, ubuntu-latest) (push) Failing after 14s
C++ / build (Release, cl, cl, windows-latest) (push) Has been cancelled
打印的小错误
2024-11-24 00:39:33 +08:00
Fleey
6a74972080
fix(lang: c, chapters: searching, sorting): Some serious errors (#1531)
Some checks failed
C / build (Release, clang, clang++, ubuntu-latest) (push) Failing after 31s
C / build (Release, gcc, g++, ubuntu-latest) (push) Failing after 12s
C / build (Release, cl, cl, windows-latest) (push) Has been cancelled
* fix: correct hash table insertion

* Use a pointer to a pointer instead of a single pointer in the insert function, ensuring proper updates to the hash table
* Bug fixes: This fixes issues with empty results.

* fix: correct issues in radix sort

* Replaced loop-based array copy with memcpy to ensure efficient memory copying in countingSortDigit
* Fixed a bug in radixSort where the maximum value search loop skipped the last element
* Bug fix: Ensures all elements are checked when determining the maximum value in the array

* perf: improve memory management by adding explicit memory release

* revert: Revert to using the old loop override array method and drop specific api's like memcpy.
2024-11-10 02:00:53 +08:00
Flamingo
57cf6b1ea6
fix some typos (#1540)
Some checks failed
Dart / Dart stable on macos-latest (push) Has been cancelled
Dart / Dart stable on ubuntu-latest (push) Has been cancelled
Dart / Dart stable on windows-latest (push) Has been cancelled
.NET / .NET 8.0.x on macos-latest (push) Has been cancelled
.NET / .NET 8.0.x on ubuntu-latest (push) Has been cancelled
.NET / .NET 8.0.x on windows-latest (push) Has been cancelled
Go / Go 1.19.x on macos-latest (push) Has been cancelled
Go / Go 1.19.x on ubuntu-latest (push) Has been cancelled
Go / Go 1.19.x on windows-latest (push) Has been cancelled
Python / Python 3.10 on macos-latest (push) Has been cancelled
Python / Python 3.11 on macos-latest (push) Has been cancelled
Python / Python 3.10 on ubuntu-latest (push) Has been cancelled
Python / Python 3.11 on ubuntu-latest (push) Has been cancelled
Python / Python 3.10 on windows-latest (push) Has been cancelled
Python / Python 3.11 on windows-latest (push) Has been cancelled
Ruby / Ruby 3.3 on macos-latest (push) Has been cancelled
Ruby / Ruby 3.3 on ubuntu-latest (push) Has been cancelled
Ruby / Ruby 3.3 on windows-latest (push) Has been cancelled
Rust / build (macos-latest) (push) Has been cancelled
Rust / build (ubuntu-latest) (push) Has been cancelled
Rust / build (windows-latest) (push) Has been cancelled
Swift / Swift on macos-14 (push) Has been cancelled
Swift / Swift on ubuntu-22.04 (push) Has been cancelled
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
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
bongbongbakudan
c12d01a752
Update my_list.js (#1511)
修改insert注释
2024-09-24 17:57:34 +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
ZhongYuuu
6b2c38cae4
[cpp] Stick with swap (#1474)
* [cpp] Stick with swap

* [cpp] Stick with swap
2024-08-06 15:08:01 +08:00
Rui
2758e06374
remove unnecessary type conversions (#1411) 2024-07-14 18:36:00 +08:00
ztkuaikuai
bc0e32af57 fix(graph): enhance the judgment of boundary conditions for removeEdge functions 2024-07-07 18:40:23 +08:00
Flamingo
4190eca41a
fix(Go): code comment error (#1404)
* fix: comment error

* fix: comment error in zn-hant version
2024-06-28 19:18:17 +08:00
rongyi
017b95f003
Make rust more idomatic (#1386) 2024-06-13 15:19:21 +08:00
nil
0774920d7f
fix(Go): Update array_queue.go and array_deque.go (#1362)
* 🐞 fix: 队列为空时不应该操作指向

* 🧪 test: 添加pop测试用例

* 🔧 build: 修改testify依赖包

* 🐞 fix: 双向队列为空时,pop不操作指向

* 🔧 build:

Remove third-party packages

* Delete codes/go/go.sum

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-05-31 17:38:27 +08:00
Yudong Jin
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
khoaxuantu
a14be17b74
[feat] add ruby code - chapter dynamic programming (#1378) 2024-05-30 17:11:56 +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
khoaxuantu
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
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
Lanjing Gong
0e221540a3
fix(c): Fix malloc allocation of secondary pointers can lead to dump issues (#1367) 2024-05-18 18:17:33 +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
khoaxuantu
9e569cf520
feat: add ruby code - chapter "divide and conquer" (#1361) 2024-05-15 18:14:15 +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
khoaxuantu
1f606d6852
feat: add ruby codes - chapter greedy (#1350) 2024-05-08 18:38:35 +08:00
rongyi
56a165bf98
cargo fmt code (#1349) 2024-05-08 18:37:38 +08:00
Yudong Jin
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
khoaxuantu
cb32c525e7
feat: Add Ruby code - chapter "Sorting" (#1333)
* feat: add ruby code - chapter sorting

* Update radix_sort.rb

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-05-03 19:46:42 +08:00
huangjikun
ee67d3e6a7
Maintain the same semantics as other languages in n_queens.go (#1329) 2024-05-03 19:40:59 +08:00
Martin Xu
59d07264fc
feat: add ruby code block - bucket sort (#1285)
* feat: add ruby code block - bucket sort

* Update codes/ruby/chapter_sorting/bucket_sort.rb

Co-authored-by: khoaxuantu <68913255+khoaxuantu@users.noreply.github.com>

* Update codes/ruby/chapter_sorting/bucket_sort.rb

Co-authored-by: khoaxuantu <68913255+khoaxuantu@users.noreply.github.com>

* Update bucket_sort.rb

---------

Co-authored-by: khoaxuantu <68913255+khoaxuantu@users.noreply.github.com>
Co-authored-by: Yudong Jin <krahets@163.com>
2024-04-30 16:00:39 +08:00
洪鈞閔 ( jasper )
68f3a453e1
feat: add ruby code block - merge sort (#1260)
* feat(codes/ruby/chapter_sorting/merge_sort.rb): add merge_sort ruby file

* feat(codes/ruby/chapter_sorting/merge_sort.rb): modify comment space

* feat(codes/ruby/chapter_sorting/merge_sort.rb): set array default value

Co-authored-by: khoaxuantu <68913255+khoaxuantu@users.noreply.github.com>

* feat(codes/ruby/chapter_sorting/merge_sort.rb): driver code add if logic

Co-authored-by: khoaxuantu <68913255+khoaxuantu@users.noreply.github.com>

* feat(codes/ruby/chapter_sorting/merge_sort.rb): modify comment style

Co-authored-by: khoaxuantu <68913255+khoaxuantu@users.noreply.github.com>

* feat(codes/ruby/chapter_sorting/merge_sort.rb): modify logic instruction

Co-authored-by: khoaxuantu <68913255+khoaxuantu@users.noreply.github.com>

---------

Co-authored-by: khoaxuantu <68913255+khoaxuantu@users.noreply.github.com>
2024-04-30 15:58:47 +08:00
洪鈞閔 ( jasper )
3f857db457
feat: add ruby code block - heap sort (#1261)
* feat(codes/ruby/chapter_sorting/heap_sort.rb): add heap_sort ruby file

* feat(codes/ruby/chapter_sorting/heap_sort.rb): modify comment space

* feat(codes/ruby/chapter_sorting/heap_sort.rb): modify code space style

* feat(codes/ruby/chapter_sorting/heap_sort.rb): modify logic instruction

Co-authored-by: khoaxuantu <68913255+khoaxuantu@users.noreply.github.com>

* feat(codes/ruby/chapter_sorting/heap_sort.rb): driver code add if logic

Co-authored-by: khoaxuantu <68913255+khoaxuantu@users.noreply.github.com>

---------

Co-authored-by: khoaxuantu <68913255+khoaxuantu@users.noreply.github.com>
2024-04-30 15:58:37 +08:00
Yudong Jin
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
huangjikun
84b1ce2497
Fix incorrect method name in permutations_ii.go (#1313) 2024-04-30 14:13:01 +08:00
bluebean-cloud
a3950e1def
feat: Add ruby codes - chapter "Heap" (#1300)
* init heap Ruby

* feature: finish chapter heap for ruby

* fix delete heap.rb

* fix: Fix code style

* Update codes/ruby/chapter_heap/my_heap.rb

Co-authored-by: khoaxuantu <68913255+khoaxuantu@users.noreply.github.com>

* Update codes/ruby/chapter_heap/top_k.rb

Co-authored-by: khoaxuantu <68913255+khoaxuantu@users.noreply.github.com>

* fix: apply the suggested changes

* fix to_a

* Update my_heap.rb

---------

Co-authored-by: khoaxuantu <68913255+khoaxuantu@users.noreply.github.com>
Co-authored-by: Yudong Jin <krahets@163.com>
2024-04-28 22:24:51 +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
khoaxuantu
9e7fbf249f
feat: add ruby code - chapter graph (#1303) 2024-04-26 17:30:55 +08:00
Shyam Chen
1a99dd420f
feat(JavaScript): Add the workflow file for CI check (#1296)
* feat(JavaScript): Add the workflow file for CI check

* Apply suggestions from code review
Co-authored-by: krahets <krahets@163.com>

* Test failure

* Update javascript.yml

* Test success

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-04-22 17:51:44 +08:00
huangjikun
54ced94e4f
Fix incorrect indexes in two_sum.go (#1297) 2024-04-22 02:28:54 +08:00
Yudong Jin
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
Shyam Chen
587344da62
feat(TypeScript): Add the workflow file for CI check (#1280)
* feat(TypeScript): Add the workflow file for CI check

* fix: Install TypeScript Execute (tsx)

* test: Test failed

* test: Test successful

* test: on windows

* Add a bug

* feat: type checking

* test: Test successful

* feat: add main

* fix: use process

* feat: use es-main

* Test failure

* feat: streamlined configuration

* Apply suggestions from code review
Co-authored-by: Yudong Jin <krahets@163.com>

* feat: remove lock file

* Test failure

* Test success

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-04-19 18:48:58 +08:00
cy-by-side
499419e4ce
Create quick_sort.rb (#1223)
* Create quick_sort.rb

* Update quick_sort.rb

* Update quick_sort.rb

* Update quick_sort.rb
2024-04-19 18:26:54 +08:00
khoaxuantu
19488b13c4
feat: add ruby codes - chapter tree (#1288) 2024-04-19 15:50:43 +08:00
khoaxuantu
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