Commit graph

1213 commits

Author SHA1 Message Date
nuquist19
2b11639103
fix(C): Update common.h (#1278)
请问这里为了防止重复包含头文件是不是应该改成COMMON_H,因为头文件名字叫做common.h
2024-04-15 14:54:28 +08:00
Yudong Jin
d484b08c15
Prepare 1.1.0 release (#1274)
* Update bucket_sort.c

* Fix the comments in quick_sort.c

* Update the announce badge

* Sync zh and zh-hant versions

* Update contributors list.

* Sync zh and zh-hant versions.

* Sync zh and zh-hant versions.

* Update the contributors list

* Update the version number
2024-04-14 20:46:20 +08:00
jiawenshi
16942dfe32
fix(C): fix the array initialization in coin_change.c (#1277)
* add

* Update coin_change.c

* Update coin_change.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-04-14 17:30:21 +08:00
curtishd
4d9bbe72e1
Improve the consistency between code and comments in Kotlin (#1268)
* style(kotlin): Make code and comments consistent.

* style(kotlin): convert comment location.

* style(c): Add missing comment.

* style(kotlin): Remove redundant semicolon, parenthesis and brace

* style(kotlin): Put constants inside the function.

* style(kotlin): fix unnecessary indentation.

* style(swift): Add missing comment.

* style(kotlin): Add missing comment.

* style(kotlin): Remove redundant comment.

* style(kotlin): Add missing comment.

* Update linked_list.kt

* style(csharp,js,ts): Add missing comment.

* style(kotlin): Remove empty lines.

* Update list.cs

* Update list.js

* Update list.ts

* roll back to commit 1

* style(cs,js,ts): Add missing comment in docfile.

* style(kotlin): Use normal element swapping instead of scope functions.
2024-04-13 20:09:39 +08:00
bluebean-cloud
92337671a6
feat: Add Ruby code - chapter "Searching" (#1262)
* create RUBY searching files & finish two_sum.rb

* finish linear_search.rb

* finish hashing_search.rb

* finish binary_search.rb

* finish binary_search_insertion.rb

* finish binary_search_edge.rb

* fix: change 'or' to '||'

* fix: Adjust the code style(ruby searching)

* fix: repair file name

* fix: Adjust the output format

* fix: fix 0...nums.length & delete useless require & change into __FILE__==0 block
2024-04-12 03:10:15 +08:00
Lanjing Gong
aca850244b
fix(C): fix array_hash_map.c and bucket_sort.c (#1272)
* fix: Fix coding error, https://github.com/krahets/hello-algo/discussions/440#discussioncomment-8958379

* fix: Fix issue 1237 https://github.com/krahets/hello-algo/issues/1237

* Update array_hash_map.c

* Update bucket_sort.c

* Update bucket_sort.c

* Update array_hash_map.c

* Update bucket_sort.c

* Update bucket_sort.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-04-12 03:03:18 +08:00
cy-by-side
49e6a208f6
Create insertion_sort.rb (#1222)
* Create insertion_sort.rb

* Update insertion_sort.rb

* Update insertion_sort.rb

* Update insertion_sort.rb
2024-04-11 20:52:54 +08:00
khoaxuantu
6404a53fc6
chore: update driver code (#1265) 2024-04-10 22:38:48 +08:00
curtishd
a3ee733e7b
fix(Kotlin): Remove empty lines (#1264) 2024-04-10 21:19:19 +08:00
echoless
30fd4ef646
添加for循环的花括号以增加可读性和可维护性 (#1249) 2024-04-10 19:01:22 +08:00
curtishd
1623e3c6a8
feat(Kotlin): Replace value with _val (#1254)
* ci(kotlin): Add workflow file.

* Update kotlin.yml

* style(kotlin): value -> _val

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-04-10 18:09:43 +08:00
Yudong Jin
78f71eeacb
Bug fixes and improvements (#1252)
* Bug fixes

* Fix the landing page of zh-hant version

* Bug fixes and add an Q&A for chapter_data_structure

* Update the mindmap for zh-hant version
2024-04-09 19:55:59 +08:00
curtishd
896d9a64f6
Refine kotlin code (#1241)
* style(kotlin): Improve kotlin codes readability.

* remove redundant quotes.

* style(kotlin): improve codes readability.

* style(kotlin): refine kotlin codes.

* Create kotlin.yml

* Create kotlin.yml

* Delete .github/workflows/kotlin

* Delete .github/workflows/main.yml

* Create kotlin.yml

* Update kotlin.yml

* Delete .github/workflows/kotlin.yml

* Create hello_world_workflow.main.kts

* Delete .github/workflows/hello_world_workflow.main.kts

* remove empty line
2024-04-09 16:26:58 +08:00
khoaxuantu
41dd677338
Add Ruby test CI (#1242)
* test: add test all Ruby code

* test: add ruby test ci

* Update ruby.yml

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-04-09 03:20:04 +08:00
curtishd
3fe8f67ba9
Improve readability of Kotlin code (#1236)
* style(kotlin): Improve kotlin codes readability.

* remove redundant quotes.

* style(kotlin): improve codes readability.
2024-04-08 16:09:34 +08:00
curtishd
5725b8a0f1
Improve readability of kotlin code (#1233)
* style(kotlin): Improve kotlin codes readability.

* remove redundant quotes.
2024-04-07 18:56:59 +08:00
khoaxuantu
e121665772
feat: add ruby code - chapter stack and queue (#1230) 2024-04-07 14:48:48 +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
khoaxuantu
4fadad50ba
fix: Some Ruby code (#1231)
* fix: ruby code block - chapter computational complexity

* fix: ruby code - chapter array and linkedlist
2024-04-07 01:39:45 +08:00
Yang Le
db164f6703
fix memory leak in the C code (#1203)
* fix memory leak when size(deque) == 1

* fix memory leak
2024-04-07 01:36:55 +08:00
curtishd
2655a2f66a
Simplify kotlin code and improve code readability (#1198)
* Add kotlin code block for chapter_hashing

* Add kotlin code block for chapter_heap.

* Add kotlin code block for chapter_stack_and_queue and chapter_tree

* fix indentation

* Update binary_tree.md

* style(kotlin): simplify code and improve readability.

* simplify kt code for chapter_computational_complexity.

* style(kotlin): replace ArrayList with MutableList.

* Update subset_sum_i.kt

Use kotlin api instead of java.

* Update subset_sum_ii.kt

use kotlin api instead of java

* style(kotlin): replace ArrayList with mutablelist.

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-04-07 01:31:58 +08:00
Yudong Jin
6e570e2863
Update README for zh-hant version (#1228)
* Bug fixes

* Fix the term in heap figures

* Unify the font of the chapter covers for the zh, en, and zh-Hant version

* Sync the zh-hant vertion with the main branch

* Update README for testing

* Update README for testing

* Update README for testing

* Update README for zh, en, zh-hant version

* Fix the issue links

* Update README

* Update README

* edition -> version
2024-04-06 03:57:46 +08:00
cy-by-side
d8cae21da3
Fix the driver code of quick_sort.cpp (#1219) 2024-04-04 19:37:18 +08:00
khoaxuantu
043085d0ea
fix: adapt missing ruby style guide (#1216) 2024-04-03 21:01:29 +08:00
cy-by-side
c435d177a1
Create chapter_computational_complexity/iteration.rb (#1207)
Co-authored-by: Yudong Jin <krahets@163.com>
2024-04-03 15:51:20 +08:00
khoaxuantu
fd580a184a
feat: Add Ruby code - chapter "computational complexity" (#1212)
* feat: add ruby code - chapter computational complexity

* feat: add ruby code blocks
2024-04-03 05:10:25 +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
khoaxuantu
5ce088de52
Fix inconsistent comments Ruby - chapter array and linked list (#1202)
* fix: inconsistent comments Ruby - chapter array and linked list

* fix: better Ruby code & comments
2024-03-31 15:58:35 +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
khoaxuantu
85ca4cce43
feat: Add ruby code - chapter "array & linked list" (#1158)
* feat: add ruby code chapter array & linked list

- array.rb
- linked_list.rb
- list.rb
- my_list.rb

* feat: add ruby code blocks

* chore: fix convention
2024-03-30 13:10:46 +08:00
rongyi
556af1624c
No need to match expand pop, just return it (#1154) 2024-03-27 01:29:43 +08:00
curtishd
9c07ca99f3
Fix the comment in recursion.kt (#1177)
* feat(kotlin): add kotlin code for utils file.

* Update ListNode.kt

* Update PrintUtil.kt

* fix: add the header comment for linkedlist_stack class.

* fix(kotlin): fix the kotlin file name.

* delete blank line in main function

* add comment for class head.

* delete the old file.

* fix the created time

* delete blank line beneath files.

* keep tailRecur function consistent with other.

* Update recursion.kt

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-03-26 03:14:13 +08:00
Yudong Jin
43bb45bceb
Several bug fixes and improvements (#1178)
* Update pythontutor block with the latest code

* Move docs-en to en/docs

* Move mkdocs.yml and README to en folder

* Fix en/mkdocs.yml

* Update the landing page

* Fix the glossary

* Reduce the font size of the code block tabs

* Add Kotlin blocks to en/docs

* Fix the code link in en/.../deque.md

* Fix the EN README link
2024-03-26 02:49:26 +08:00
curtishd
42f48405ef
Fix all the incorrect comment in kotin files (#1176)
* feat(kotlin): add kotlin code for utils file.

* Update ListNode.kt

* Update PrintUtil.kt

* fix: add the header comment for linkedlist_stack class.

* fix(kotlin): fix the kotlin file name.

* delete blank line in main function

* add comment for class head.

* delete the old file.

* fix the created time

* delete blank line beneath files.

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-03-25 22:14:55 +08:00
curtishd
5ec5ef9af0
Add kotlin code for the utils file (#1175)
* feat(kotlin): add kotlin code for utils file.

* Update ListNode.kt

* Update PrintUtil.kt

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-03-25 19:15:40 +08:00
curtishd
5e77a64341
Add kotlin code for the chapter of tree (#1172)
* modified array.kt.

* feat(kotlin): add kotlin code for the chapter of stack and queue.

* modified array.kt

* modified comments.

* feat(kotlin): add kotlin code for the chapter of tree.

* feat(kotlin): add kotlin code for the chapter of tree.
2024-03-25 16:22:17 +08:00
curtishd
6069cb89a7
Add kotlin code for the chapter of stack and queue (#1162)
* modified array.kt.

* feat(kotlin): add kotlin code for the chapter of stack and queue.

* modified array.kt

* modified comments.
2024-03-23 19:33:18 +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
nuomi1
7359a7cb4b
Review Swift codes (#1150)
* feat(swift): review for chapter_computational_complexity

* feat(swift): review for chapter_data_structure

* feat(swift): review for chapter_array_and_linkedlist

* feat(swift): review for chapter_stack_and_queue

* feat(swift): review for chapter_hashing

* feat(swift): review for chapter_tree

* feat(swift): add codes for heap article

* feat(swift): review for chapter_heap

* feat(swift): review for chapter_graph

* feat(swift): review for chapter_searching

* feat(swift): review for chapter_sorting

* feat(swift): review for chapter_divide_and_conquer

* feat(swift): review for chapter_backtracking

* feat(swift): review for chapter_dynamic_programming

* feat(swift): review for chapter_greedy

* feat(swift): review for utils

* feat(swift): update ci tool

* feat(swift): trailing closure

* feat(swift): array init

* feat(swift): map index
2024-03-20 21:15:39 +08:00
Nan Lei
300a781fab
Update code comment of quadratic in time_complexity (#1155) 2024-03-19 02:28:16 +08:00
curtishd
1845937c5a
Add kotlin code for the chapter of sorting (#1145)
* feat(kotlin): add kotlin code for chapter sorting.

* style(kotlin): fix some indent.

* refactor(kotlin): refactor quick_sort.kt files.

* style(kotlin): modified medianThree function.
2024-03-18 13:34:20 +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
curtishd
54ceef3443
feat(kotlin): add kotlin codes for the chapter of searching. (#1140) 2024-03-15 17:11:41 +08:00
curtishd
a05192ea0f
Add kotlin code for the chapter of heap (#1115)
* feat(kotlin): add kotlin code for dynamic programming.

* Update knapsack.kt

* feat(kotlin): add kotlin codes for graph.

* style(kotlin): reformatted the codes.

* feat(kotlin): add kotlin codes for the chapter of greedy.

* Update max_product_cutting.kt

* feat(kotlin): add kotlin code for chapter of hashing.

* style(kotlin): modified some comment

* Update array_hash_map.kt

* Update hash_map_chaining.kt

* Update hash_map_chaining.kt

* feat(kotlin): add kotlin codes for the chapter of heap.

* Update my_heap.kt
2024-03-15 01:12:00 +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
Prime.X
644eaf99ff
fix: code comments for insertion_sort.go (#1132)
* fix: code comments for insertion_sort.go

* Update insertion_sort.go

---------

Co-authored-by: Prime Xiao <primexiao.dev@gmail.com>
Co-authored-by: Yudong Jin <krahets@163.com>
2024-03-14 20:25:21 +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
curtishd
eadf4c86d4
Add kotlin code for the chapter of hashing (#1104)
* feat(kotlin): add kotlin code for dynamic programming.

* Update knapsack.kt

* feat(kotlin): add kotlin codes for graph.

* style(kotlin): reformatted the codes.

* feat(kotlin): add kotlin codes for the chapter of greedy.

* Update max_product_cutting.kt

* feat(kotlin): add kotlin code for chapter of hashing.

* style(kotlin): modified some comment

* Update array_hash_map.kt

* Update hash_map_chaining.kt

* Update hash_map_chaining.kt
2024-03-12 14:08:15 +08:00
curtishd
89679a4a13
Add kotlin codes for the chapter of greedy (#1103)
* feat(kotlin): add kotlin code for dynamic programming.

* Update knapsack.kt

* feat(kotlin): add kotlin codes for graph.

* style(kotlin): reformatted the codes.

* feat(kotlin): add kotlin codes for the chapter of greedy.

* Update max_product_cutting.kt
2024-03-04 00:10:34 +08:00
curtishd
6a728042fd
Add kotlin code for the chapter of graph (#1102)
* feat(kotlin): add kotlin code for dynamic programming.

* Update knapsack.kt

* feat(kotlin): add kotlin codes for graph.

* style(kotlin): reformatted the codes.
2024-03-03 19:18:07 +08:00
curtishd
5c1f43fefd
Add kotlin code for dynamic programming (#1099)
* feat(kotlin): add kotlin code for dynamic programming.

* Update knapsack.kt
2024-03-03 15:14:26 +08:00
curtishd
7cdfa03e68
Add kotlin code for the chapter of divide and conquer (#1098)
* feat(kotlin):new kotlin support files

* fix(kotlin):

    reviewed the formatting, comments and so on.

* fix(kotlin): fix the indentation and format

* feat(kotlin): Add kotlin code for the backtraking chapter.

* fix(kotlin): fix incorrect output of preorder_traversal_iii_template.kt file

* fix(kotlin): simplify kotlin codes

* fix(kotlin): modify n_queens.kt for consistency.

* feat(kotlin): add kotlin code for computational complexity.

* fix(kotlin): remove iteration folder.

* fix(kotlin): remove n_queens.kt file out of folder.

* fix(kotlin): remove some folders.

* style(kotlin): modified two chapters.

* feat(kotlin): add kotlin code for divide and conquer.

* Update build_tree.kt

* Update hanota.kt

* Delete codes/kotlin/chapter_backtracking directory

* Delete codes/kotlin/chapter_computational_complexity directory

* Delete codes/kotlin/chapter_divide_and_conquer directory

* feat(kotlin): add kotlin code for divide and conquer.

* Update hanota.kt
2024-02-28 01:25:38 +08:00
curtishd
306dc019ef
Add Kotlin code for computational complexity (#1090)
* feat(kotlin):new kotlin support files

* fix(kotlin):

    reviewed the formatting, comments and so on.

* fix(kotlin): fix the indentation and format

* feat(kotlin): Add kotlin code for the backtraking chapter.

* fix(kotlin): fix incorrect output of preorder_traversal_iii_template.kt file

* fix(kotlin): simplify kotlin codes

* fix(kotlin): modify n_queens.kt for consistency.

* feat(kotlin): add kotlin code for computational complexity.

* fix(kotlin): remove iteration folder.

* fix(kotlin): remove n_queens.kt file out of folder.

* fix(kotlin): remove some folders.

* style(kotlin): modified two chapters.
2024-02-27 17:04:57 +08:00
Arthur
962f8f91f7
fix some bugs in c codes (#1089) 2024-02-23 01:34:49 +08:00
curtishd
507357ace1
feat(kotlin): Add kotlin code for backtracking chapter (#1088)
* feat(kotlin):new kotlin support files

* fix(kotlin):

    reviewed the formatting, comments and so on.

* fix(kotlin): fix the indentation and format

* feat(kotlin): Add kotlin code for the backtraking chapter.

* fix(kotlin): fix incorrect output of preorder_traversal_iii_template.kt file

* fix(kotlin): simplify kotlin codes

* fix(kotlin): modify n_queens.kt for consistency.
2024-02-21 01:57:41 +08:00
Reanon
e9341c51b5
fix(go): record slice array result, fixed #1075 (#1087) 2024-02-18 18:37:07 +08:00
curtishd
4b990c10ce
feat(Kotlin): Add Kotlin code for the array and linked list chapter (#1070)
* feat(kotlin):new kotlin support files

* fix(kotlin):

    reviewed the formatting, comments and so on.

* fix(kotlin): fix the indentation and format
2024-02-07 22:55:29 +08:00
Yudong Jin
a005c6ebd3
Some improvements (#1073)
* Update avatar's link in the landing page

* Bug fixes

* Move assets folder from overrides to docs

* Reduce figures' corner radius

* Update copyright

* Update header image

* Krahets -> krahets

* Update the landing page
2024-02-07 22:21:18 +08:00
易春风
d4d281cd67
Fix the issue of discussion 514 (#1064) 2024-01-27 19:42:19 +08:00
Scai
84f4b8d285
fix: Update linkedlist_deque.cpp (#1062)
There is something error when delete node, should 'delete front' or 'delete rear' outside the body of if cycle.
2024-01-25 12:51:17 +08:00
gonglja
e69f60c07c
fix(linkedlist_queue.c): Remove redundant conditional judgments. (#1055) 2024-01-23 22:09:45 +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
hpstory
b9ae4ffe9a
feature: add auto-build-and-test workflow for go (#1019)
* fix(csharp): unified array statement

* feature: add workflow for go/js/ts/zig

* fix python UnicodeDecodeError on windows

* Update space_complexity.go

* Update space_complexity_test.go

* Update space_complexity.go

* remove nodejs, zip workflow

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2024-01-12 14:17:21 +08:00
Yudong Jin
0b7e99dafa
feat: Adjust the size of pythontutor blocks (#1036)
* Update the style of the python tutor blocks

* Use pythontutor links instead of iframe in the documents
2024-01-09 16:09:35 +08:00
Yudong Jin
d3cb600910
translation: Add the initial translation of the chapter of stack and queue (#1033)
* Update the format of Q&As in docs-en

* Fix the code comments of JavaScript and TypeScript

* Add the initial translation of the chapter of stack and queue
2024-01-08 19:06:37 +08:00
Yudong Jin
ee485372fe
feat: Add pythontutor blocks to the rest of the chapters (#1030)
* Fix Python code

* Add the pythontutor blocks of the chapter tree, heap, graph, searching, sorting, divide and conquer, dynamic programming and greedy.
Improve the pythontutor blocks of the chapter array and linkedlist and backtracking.
Add the tutorial of pythontutor in how-to-read section.

* Reduce the image's file size.
2024-01-07 23:49:26 +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
Justin Tse
0f5b924036
Fix: recursion bug for JS and TS (#1028) 2024-01-06 16:29:39 +08:00
易春风
ad663615e6
Fix the issues of discusscomment 7949412 and 7985550 (#1027) 2024-01-06 14:47:32 +08:00
th1nk3r-ing
d06503b50b
fix(cpp): cmake compile my_list.cpp for target list (#1025) 2024-01-05 17:29:53 +08:00
gonglja
3a559f1b60
Fix some code bugs (#1021)
* fix(counting_sort.c): Fix access out-of-bounds issue

* fix(hash_map_open_addressing.c): Fix coding errors

* fix(binary_search_tree.c): Fix unreleased memory

* Update indentataion
2024-01-02 21:45:01 +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
Yudong Jin
6d961d38a0
Several improvements (#1002)
* Update buttons.

* Update button svg

* Update button

* Update README.md

* Update index.md

* Update translation of about_the _book

* Update English headings.
2023-12-24 10:37:25 +08:00
易春风
b115a2b895
Fix the issue of discuss comment 7919887 (#996) 2023-12-23 23:20:26 +08:00
Yudong Jin
46813a5247
translation: English Translation of the chapter of preface(part), introduction and complexity analysis(part) (#994)
* Translate 1.0.0b6 release with the machine learning translator.

* Update Dockerfile
A few translation improvements.

* Fix a badge logo.

* Fix EN translation of chapter_appendix/terminology.md (#913)

* Update README.md

* Update README.md

* translation: Refined the automated translation of README (#932)

* refined the automated translation of README

* Update index.md

* Update mkdocs-en.yml

---------

Co-authored-by: Yudong Jin <krahets@163.com>

* translate: Embellish chapter_computational_complexity/index.md (#940)

* translation: Update chapter_computational_complexity/performance_evaluation.md (#943)

* Update performance_evaluation.md

* Update performance_evaluation.md

* Update performance_evaluation.md

change 'methods' to 'approaches' on line 15

* Update performance_evaluation.md

on line 21, change the sentence to 'the results could be the opposite on another computer with different specifications.'

* Update performance_evaluation.md

delete two short sentence on line 5 and 6

* Update performance_evaluation.md

change `unavoidable` to `inevitable` on line 48

* Update performance_evaluation.md

small changes on line 23

* translation: Update terminology and improve readability in preface summary (#954)

* Update terminology and improve readability in preface summary

This commit made a few adjustments in the 'summary.md' file for clearer and more accessible language. "Brushing tool library" was replaced with "Coding Toolkit" to better reflect common terminology. Also, advice for beginners in algorithm learning journey was reformulated to imply a more positive approach avoiding detours and common pitfalls. The section related to the discussion forum was rewritten to sound more inviting to readers.

* Format

* Optimize the translation of
chapter_introduction/algorithms_are_everywhere.

* Add .gitignore to Java subfolder.

* Update the button assets.

* Fix the callout

* translation: chapter_computational_complexity/summary to en (#953)

* translate chapter_computational_complexity/summary

* minor format

* Update summary.md with comment

* Update summary.md

* Update summary.md

* translation: chapter_introduction/what_is_dsa.md (#962)

* Optimize translation of what_is_dsa.md

* Update

* translation: chapter_introduction/summary.md (#963)

* Translate chapter_introduction/summary.md

* Update

* translation: Update README.md (#964)

* Update en translation of README.md

* Update README.md

* translation: update space_complexity.md (#970)

* update space_complexity.md

* the rest of translation piece

* Update space_complexity.md

---------

Co-authored-by: ThomasQiu <thomas.qiu@mnfgroup.limited>
Co-authored-by: Yudong Jin <krahets@163.com>

* translation: Update chapter_introduction/index.md (#971)

* Update index.md

sorry, first time doing this... now this is the final change.
changes:
title of the chapter is shorter.
refined the abstract.

* Update index.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>

* translation: Update chapter_data_structure/classification_of_data_structure.md (#980)

* update classification_of_data_structure.md

* Update classification_of_data_structure.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>

* translation: Update chapter_introduction/algorithms_are_everywhere.md (#972)

* Update algorithms_are_everywhere.md

changed or refined parts of the words and sentences including tips.
Some of them I didnt change that much because im worried that it might not meet the requirement of accuracy. 
some other ones i changed a lot to make it sound better, but also kind of following the same wording as the CN version

* Update algorithms_are_everywhere.md

re-edited the dictionary part from Piyin to just normal Eng dictionary. 
again thank you very much hpstory for you suggestion.

* Update algorithms_are_everywhere.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>

* Prepare merging into main branch.

* Update buttons

* Update Dockerfile

* Update index.md

* Update index.md

* Update README

* Fix index.md

* Fix mkdocs-en.yml

---------

Co-authored-by: Yuelin Xin <sc20yx2@leeds.ac.uk>
Co-authored-by: Phoenix Xie <phoenixx0415@gmail.com>
Co-authored-by: Sizhuo Long <longsizhuo@gmail.com>
Co-authored-by: Spark <qizhang94@outlook.com>
Co-authored-by: Thomas <thomasqiu7@gmail.com>
Co-authored-by: ThomasQiu <thomas.qiu@mnfgroup.limited>
Co-authored-by: K3v123 <123932560+K3v123@users.noreply.github.com>
Co-authored-by: Jin <36914748+yanedie@users.noreply.github.com>
2023-12-22 00:16:18 +08:00
krahets
9a5ab776d6 A bug fix. 2023-12-19 21:55:57 +08:00
krahets
d9686e57dd Fix bubble_sort.c 2023-12-18 22:52:00 +08:00
Reanon
d0f4fa69a6
fix(go): fix go code , refer to @joengtou @wcig @shenjq (#992) 2023-12-16 18:52:28 +08:00
Yudong Jin
ed4de4644f
Revised the book. (#987) 2023-12-14 02:42:53 +08:00
gonglja
d67c458caa
fix(codes/c): Fix bubble_sort.c (#983) 2023-12-11 00:42:45 +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
b824d149cb
fix: Several code bug fixes (#973)
* Update counting_sort.c and quick_sort.c

* Code bug fixes.
2023-11-29 23:14:55 +08:00
hpstory
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 <krahets@163.com>
2023-11-26 23:18:44 +08:00
gonglja
d960c99a1f
fix: bug fixes for array_hash_map.c and counting_sort.c (#968)
* fix(codes/cpp): Memory leak fix: the space was not freed when pop removed the element.

* fix(codes/cpp): Fix access error when printArray(arr, 0)

* Update PrintUtil.hpp

* fix(codes/c): Fix some errors of cmake build

* feat(codes/c): Add hashing_search.c

* styles(codes/c): Modify function description

* styles(codes/c): Modify binary_search.c code style

* fix(codes/c): Fix the problem in binary_tree_bfs.c and the problem that the memory is not released.

* feat: Add preorder_traversal_i_compact.c

* feat(codes/c): Add head_sort.c

* feat(codes/c): Add bucket_sort.c

* feat(codes/c): Add binary_search_edge.c

* fix(codes/c): Add programs that are not managed by cmake (c code)

* feat(codes/c): Add selection_sort.c

* style(codes/c): Change swap in selection_sort.c to `selectionSort`

* styles(codes/c): Change style.

* fix(codes/c): Fix some formatting errors and temporarily remove backtracking chapters

* fix(codes/c): Fix space_complexity.c build error.

* feat(codes/c): Add array_binary_tree.c

* feat(code/c): Update push_back and pop_back in vector.h

* styles(codes/c): Adjust  format.

* feat(codes/c): Add `interation.c ` `recursion.c` `simple_hash.c` `binary_search_edge.c` `binary_search_insertion.c` in C codes.

* fix(mylist.c): Fix `insert` function in `mylist.c`

https://github.com/krahets/hello-algo/discussions/32#discussioncomment-6974163

* feat(codes/c): Add binary_search_recur.c

* fix(codes/c): Bug fixes in discussion
https://github.com/krahets/hello-algo/discussions/78\#discussioncomment-7611511
https://github.com/krahets/hello-algo/discussions/428\#discussioncomment-7637613

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-11-26 22:56:30 +08:00
0x6AcE
c5e37c1b41
Simplify the code in array.swift (#960)
* 简单点

* Apply suggestions from code review

Co-authored-by: nuomi1 <nuomi1@qq.com>

---------

Co-authored-by: Yudong Jin <krahets@163.com>
Co-authored-by: nuomi1 <nuomi1@qq.com>
2023-11-23 15:20:17 +08:00
selear
5b6fb34a82
fix: Use .equals() to compare two strings in Java (#961) 2023-11-21 21:20:04 +08:00
krahets
a01363234c Add auto-build-and-check workflow for Java. 2023-11-17 01:11:13 +08:00
Yudong Jin
f7c41b6bef
fix: Update C code for compatibility with the MSVC compiler (#949)
* Replace VLA with malloc
Replace VLA with malloc to make C code
compatible with cl compiler on Windows.

* Fix C code for CI compiler.

* Fix C code compability to CI.

* check the trigger
2023-11-17 00:29:54 +08:00
krahets
49745cf2d2 Add the link of math.h lib in CMakeList. 2023-11-16 21:14:20 +08:00
liuyuxin
82f006372e
fix(Dart): Avoid using num as a variable name (#946) 2023-11-16 00:32:39 +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
Justin Tse
2b0cf6f9ab
fix: the bug for the array binary tree from ts and js code (#936) 2023-11-13 14:06:17 +08:00
易春风
c81d5e091b
Unsize type must be greater than or equal to 0 (#931) 2023-11-09 17:21:09 +08:00
hpstory
99fd891d76
feat: add csharp sdk to dockerfile (#929)
* feature: add csharp sdk to dockerfile

* Update docker-compose.yml

* Update Dockerfile

* remove env file

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-11-08 17:35:20 +08:00