Commit graph

1213 commits

Author SHA1 Message Date
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
Yudong Jin
d5ee877fd8
feat: Add Docker for code debugging (#927)
* Update Dockerfile and docker-compose.yml

* Add Dockerfile for code debugging.
Add installation procedures of python, cpp and java.
2023-11-08 03:20:29 +08:00
krahets
5f3ad1ed3d A few bug fixes. 2023-11-03 22:48:43 +08:00
Yudong Jin
23cce00e09
Fix Python build check script. (#911)
* Fix Python build check script.

* Update python code check workflow

* Update python test script.

* Compatible with Python >=3.9

* Compatible with Python >=3.10

* Fix errors in Windows

* test

* Add Python version in installation.md

* Update test_all.py
2023-11-02 21:58:14 +08:00
krahets
355cc3a6b1 Bug fixes to C code. 2023-11-01 05:14:22 +08:00
Yudong Jin
9c28619839
feat: Reimplement the graph code for C (#901)
* Reimplement the graph code for C

* Free memory of **vertices.
2023-10-29 19:52:19 +08:00
krahets
db5d1d21f3 Several bug fixes. 2023-10-29 00:09:54 +08:00
Justin Tse
c37f0981f0
feat: refactor top_k.ts (#899) 2023-10-28 14:27:52 +08:00
lucas
f98b337144
refactor: Re-implement hanota.c (#885)
* feat: re-impl hanota.c

* chore: Remove useless comment code

* Update hanota.c

* Update hanota.c

* Update print_util.h

* Update CMakeLists.txt

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-10-27 23:41:58 +08:00
Yudong Jin
492a69ebca
refactor: Replace vector with array in C code (#894)
* Re-implement merge sort function.

* Replace vector with array for C.

* fix
2023-10-27 23:26:48 +08:00
krahets
5385057993 Replace "结点" with "节点". 2023-10-27 23:24:13 +08:00
nuomi1
7605cab160
feature(swift): Reimplement merge_sort and top_k (#898)
* feat: Add swift-collections

* fix: use heap

* refactor: merge

* fix: import HeapModule
2023-10-27 22:59:54 +08:00
liuyuxin
1ab83bd3ef
refactor(dart): Re-implement merge sort function (#896) 2023-10-27 16:00:26 +08:00
krahets
bd8cda325e A few improvements to the C code. 2023-10-27 01:13:36 +08:00
krahets
0e10274bb4 Update arrayToTree() and treeToArray() for C. 2023-10-27 01:04:17 +08:00
krahets
5b1a219b8b Fine-tune code and texts. 2023-10-27 01:01:21 +08:00
易春风
3628b40f44
refactor: re-implement the rust codes of merge sort (#891) 2023-10-26 22:24:02 +08:00
Yudong Jin
e441ee4e35
Re-implement merge sort function. (#888) 2023-10-26 02:56:33 +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
liuyuxin
a8b2350705
feat(dart): Add build check for Dart (#886)
* feat(dart): Add build check for Dart

* feat(dart): Add dart analyze to check

* fix(dart): remove dart analyze

* feat(dart): Ignore unused variable and add dart analyze
2023-10-25 23:15:53 +08:00
Yudong Jin
d26e811e10
Several bug fixes and improvements. (#887)
* fix the bugs of C code.

* Add a header figure.

* Improve the definition of tree node height.
2023-10-25 22:59:25 +08:00
52coder
436b6fa9a6
Add C++ iterator example for C++ (#837)
* 增加c++迭代器访问示例

* Update hash_map.md

* Update hash_map.cpp

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-10-24 23:59:10 +08:00
Spark
2035aa0cf1
feat: iteration & recursion in Zig (#804)
* iteration & recursion in Zig

* missing part in time_complexity.md (zig)

* build.zig sync

* Update recursion.zig

* Update iteration.zig

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-10-24 23:49:13 +08:00
Yudong Jin
19023148ba
feat: Update the implementation of hash_map_open_addressing.js and .ts (#881)
* add permutations_ii.c and re-implement permutations_i.c

* Update the implementation of hash_map_open_addressing.js and .ts

* Update hash_map_open_addressing.js

* Update hash_map_open_addressing.js
2023-10-24 23:46:34 +08:00
hpstory
fb3ce050c1
feat(csharp): add .net building and testing workflow, solution file (#879) 2023-10-24 17:13:29 +08:00
krahets
17252b53a9 Format code and docs. 2023-10-24 16:19:29 +08:00
Reese Wellin
88a1e4aaac
refactor(JS, TS): Improve code readability in edit_distance (#860)
* fix(JS、TS): chapter_sorting QuickSortMedian and QuickSortTailCall example

* refactor(JS、TS): Improve code readability in edit_distance

* Updated code
2023-10-24 15:32:20 +08:00
krahets
d27890d98d Fix automating build workflow for Python 2023-10-23 16:06:33 +08:00
krahets
b7c110e5ec Add build check with py_compile 2023-10-23 06:02:34 +08:00
sjinzh
0c470d19c8
upate build.zig (#874) 2023-10-23 03:20:16 +08:00
krahets
5aacf2dfe0 Improve Python code for importing modules. 2023-10-19 16:21:51 +08:00
krahets
1e49574332 Simplify struct declarations of C.
Use PascalCase for all structs in C.
SImplify n_queens.c
Format C code for chapter of graph.
2023-10-18 02:16:26 +08:00
krahets
5392afd44b fix several bugs 2023-10-17 23:45:31 +08:00
Yudong Jin
51405c0669
add permutations_ii.c and re-implement permutations_i.c (#868) 2023-10-17 10:20:10 -05:00
lucas
37872726b0
feat: build_tree.c translation (#847)
* feat: build_tree.c translation

* Update CMakeLists.txt

* chore: find with map

* change inordermap

* Update build_tree.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-10-17 08:47:16 -05:00
Yudong Jin
ea7275ab6a
add forLoopRecur in recursion.c (#866) 2023-10-17 07:28:17 -05:00
krahets
346c8451de Fix code naming style. 2023-10-15 21:18:09 +08:00
krahets
ada37fd1f8 Fix Python code. 2023-10-14 22:15:02 +08:00
krahets
2976d9ff56 Fix Python code. 2023-10-14 21:54:47 +08:00
krahets
a8c624fa5a Fix the code in min_path_sum 2023-10-14 03:25:11 +08:00
Yudong Jin
3df5c36370
refactor: Improve the hash_map_chaining.c implementation. (#858)
* Improve the hash_map_chaining.c implementation.

* Update hash_map_chaining.c
2023-10-13 02:04:45 -05:00
krahets
84e2799f1b Fix hash_map_chaining.c and
hash_map_open_addressing.c
2023-10-13 14:32:49 +08:00
lclc6
fe01f77ff8
Create hash_map_open_addressing.c (#838)
* Create hash_map_open_addressing.c

哈希冲突-C语言

* Update hash_map_open_addressing.c

* Update hash_map_open_addressing.c

* Update hash_map_open_addressing.c
2023-10-13 01:15:23 -05:00
FreddieLi
61eca92055
fix get() in hash_map_chaining.c (#845)
Fix get function.
2023-10-13 01:09:06 -05:00
krahets
da5ef293d9 fix a typo 2023-10-11 17:39:56 +08:00
krahets
c37b7c807b Several bug fixes 2023-10-09 18:21:18 +08:00
krahets
fb552987f5 Update variable names in list and my_list 2023-10-09 18:20:42 +08:00
lucas
704b638d89
feat: n_queens.c translation (#774)
* feat: tranlating n_queens.c

* Reference to c++ code with additional comments

* Update n_queens.c

* Update n_queens.c

* Format n_queens.c

* Update n_queens.c

keep  the file header information format consistent with others

* fine tune

* fine tune

* Delete mkdocs-en.yml

* Update README.md

---------

Co-authored-by: krahets <krahets@163.com>
2023-10-08 12:42:32 -05:00
hpstory
e03022d5fb
fix: Polishing code format on linearLogRecur, convert String type to string (#841) 2023-10-08 07:33:30 -05:00
王作勋
2bba70fd87
Add Edit distance in C code (#835)
* Update vector.h

增加功能列表:
获取向量的第 i 个元素
设置向量的第 i 个元素
向量扩容
向量缩容
向量插入元素
向量删除元素
向量交换元素
向量是否为空
向量是否已满
向量是否相等
对向量内部进行排序(升序/降序)
对向量某段数据排序(升序/降序)

* Create hanota.c

* 新增binary_search_recur.c

* Update vector.h

* Delete codes/c/chapter_divide_and_conquer directory

* Update vector.h

* Create binary_search_recur.c

* Delete codes/chapter_divide_and_conquer directory

* Update vector.h

* old vector.h

* Create edit_distance.c

* Update edit_distance.c

* Update edit_distance.c

* Update edit_distance.c

* Create CMakeLists.txt

* Update edit_distance.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-10-07 22:29:44 -05:00
王作勋
1a3b819355
Add Climbing stairs constraint dp in C code (#829)
* Update vector.h

增加功能列表:
获取向量的第 i 个元素
设置向量的第 i 个元素
向量扩容
向量缩容
向量插入元素
向量删除元素
向量交换元素
向量是否为空
向量是否已满
向量是否相等
对向量内部进行排序(升序/降序)
对向量某段数据排序(升序/降序)

* Create hanota.c

* 新增binary_search_recur.c

* Update vector.h

* Delete codes/c/chapter_divide_and_conquer directory

* Update vector.h

* Create binary_search_recur.c

* Delete codes/chapter_divide_and_conquer directory

* Update vector.h

* Create climbing_stairs_constraint_dp.c

* RollBack vector.h

* Create CMakeLists.txt

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-10-07 22:28:23 -05:00
krahets
51dab9dd25 Update overrides directory structure. 2023-10-08 04:42:57 +08:00
hpstory
f62256bee1
fix(csharp): Modify method name to PascalCase, simplify new expression (#840)
* Modify method name to PascalCase(array and linked list)

* Modify method name to PascalCase(backtracking)

* Modify method name to PascalCase(computational complexity)

* Modify method name to PascalCase(divide and conquer)

* Modify method name to PascalCase(dynamic programming)

* Modify method name to PascalCase(graph)

* Modify method name to PascalCase(greedy)

* Modify method name to PascalCase(hashing)

* Modify method name to PascalCase(heap)

* Modify method name to PascalCase(searching)

* Modify method name to PascalCase(sorting)

* Modify method name to PascalCase(stack and queue)

* Modify method name to PascalCase(tree)

* local check
2023-10-07 12:33:46 -05:00
47
70cff2d99f
fix: Fixed the state transition error in minCostClimbingStairsDP function (#839)
Signed-off-by: foursevenlove <foursevenlove@gmail.com>
2023-10-07 08:52:12 -05:00
Nepenthe
61e1d1faec
feat(go): add forLoopRecur func (#816) 2023-10-07 08:47:58 -05:00
王作勋
ef87bd494a
Add Binary search recur in C code (#820)
* Update vector.h

增加功能列表:
获取向量的第 i 个元素
设置向量的第 i 个元素
向量扩容
向量缩容
向量插入元素
向量删除元素
向量交换元素
向量是否为空
向量是否已满
向量是否相等
对向量内部进行排序(升序/降序)
对向量某段数据排序(升序/降序)

* Create hanota.c

* 新增binary_search_recur.c

* Update vector.h

* Delete codes/c/chapter_divide_and_conquer directory

* Update vector.h

* Create binary_search_recur.c

* Create CMakeLists.txt

* Update vector.h

* RollBack vector.h

* Update CMakeLists.txt

* Update binary_search_recur.c

* Update binary_search_recur.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-10-07 08:47:05 -05:00
王作勋
2b59c9ce88
Add Coin change ii in C code (#834)
* Update vector.h

增加功能列表:
获取向量的第 i 个元素
设置向量的第 i 个元素
向量扩容
向量缩容
向量插入元素
向量删除元素
向量交换元素
向量是否为空
向量是否已满
向量是否相等
对向量内部进行排序(升序/降序)
对向量某段数据排序(升序/降序)

* Create hanota.c

* 新增binary_search_recur.c

* Update vector.h

* Delete codes/c/chapter_divide_and_conquer directory

* Update vector.h

* Create binary_search_recur.c

* Delete codes/chapter_divide_and_conquer directory

* Update vector.h

* old vector.h

* Create coin_change_ii.c

* Update coin_change_ii.c

* Create CMakeLists.txt

* Update coin_change_ii.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-10-07 08:41:09 -05:00
王作勋
8b4d3300c3
Add Coin change in C code (#833)
* Update vector.h

增加功能列表:
获取向量的第 i 个元素
设置向量的第 i 个元素
向量扩容
向量缩容
向量插入元素
向量删除元素
向量交换元素
向量是否为空
向量是否已满
向量是否相等
对向量内部进行排序(升序/降序)
对向量某段数据排序(升序/降序)

* Create hanota.c

* 新增binary_search_recur.c

* Update vector.h

* Delete codes/c/chapter_divide_and_conquer directory

* Update vector.h

* Create binary_search_recur.c

* Delete codes/chapter_divide_and_conquer directory

* Update vector.h

* old vector.h

* Create coin_change.c

* Update coin_change.c

* Update coin_change.c

* Create CMakeLists.txt

* Update coin_change.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-10-07 08:40:17 -05:00
王作勋
d75a2eb691
Add Unbounded knapsack in C code (#832)
* Update vector.h

增加功能列表:
获取向量的第 i 个元素
设置向量的第 i 个元素
向量扩容
向量缩容
向量插入元素
向量删除元素
向量交换元素
向量是否为空
向量是否已满
向量是否相等
对向量内部进行排序(升序/降序)
对向量某段数据排序(升序/降序)

* Create hanota.c

* 新增binary_search_recur.c

* Update vector.h

* Delete codes/c/chapter_divide_and_conquer directory

* Update vector.h

* Create binary_search_recur.c

* Delete codes/chapter_divide_and_conquer directory

* Update vector.h

* old vector.h

* Create unbounded_knapsack.c

* Update unbounded_knapsack.c

* Update unbounded_knapsack.c

* Create CMakeLists.txt

* Update unbounded_knapsack.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-10-07 08:38:02 -05:00
王作勋
1364bc52e7
Add Min path sum in C code (#831)
* Update vector.h

增加功能列表:
获取向量的第 i 个元素
设置向量的第 i 个元素
向量扩容
向量缩容
向量插入元素
向量删除元素
向量交换元素
向量是否为空
向量是否已满
向量是否相等
对向量内部进行排序(升序/降序)
对向量某段数据排序(升序/降序)

* Create hanota.c

* 新增binary_search_recur.c

* Update vector.h

* Delete codes/c/chapter_divide_and_conquer directory

* Update vector.h

* Create binary_search_recur.c

* Delete codes/chapter_divide_and_conquer directory

* Update vector.h

* old vector.h

* Create min_path_sum.c

* Update min_path_sum.c

* Update min_path_sum.c

* Create CMakeLists.txt

* Update min_path_sum.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-10-07 08:36:52 -05:00
王作勋
946853431f
Add Knapsack in C code (#830)
* Update vector.h

增加功能列表:
获取向量的第 i 个元素
设置向量的第 i 个元素
向量扩容
向量缩容
向量插入元素
向量删除元素
向量交换元素
向量是否为空
向量是否已满
向量是否相等
对向量内部进行排序(升序/降序)
对向量某段数据排序(升序/降序)

* Create hanota.c

* 新增binary_search_recur.c

* Update vector.h

* Delete codes/c/chapter_divide_and_conquer directory

* Update vector.h

* Create binary_search_recur.c

* Delete codes/chapter_divide_and_conquer directory

* Update vector.h

* old vector.h

* Create knapsack.c

* Update knapsack.c

* Update knapsack.c

* Create CMakeLists.txt

* Update knapsack.c

* Update knapsack.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-10-07 08:33:41 -05:00
王作勋
c6bc10a101
Add Min cost climbing stairs dp in C code (#828)
* Update vector.h

增加功能列表:
获取向量的第 i 个元素
设置向量的第 i 个元素
向量扩容
向量缩容
向量插入元素
向量删除元素
向量交换元素
向量是否为空
向量是否已满
向量是否相等
对向量内部进行排序(升序/降序)
对向量某段数据排序(升序/降序)

* Create hanota.c

* 新增binary_search_recur.c

* Update vector.h

* Delete codes/c/chapter_divide_and_conquer directory

* Update vector.h

* Create binary_search_recur.c

* Delete codes/chapter_divide_and_conquer directory

* Update vector.h

* Create min_cost_climbing_stairs_dp.c

* Update min_cost_climbing_stairs_dp.c

* Update min_cost_climbing_stairs_dp.c

* RollBack vector.h

* Update min_cost_climbing_stairs_dp.c

* Update min_cost_climbing_stairs_dp.c

* Create CMakeLists.txt

* Update min_cost_climbing_stairs_dp.c
2023-10-07 08:32:35 -05:00
王作勋
21fa72ea9f
Add hanota in C code (#819)
* Update vector.h

增加功能列表:
获取向量的第 i 个元素
设置向量的第 i 个元素
向量扩容
向量缩容
向量插入元素
向量删除元素
向量交换元素
向量是否为空
向量是否已满
向量是否相等
对向量内部进行排序(升序/降序)
对向量某段数据排序(升序/降序)

* Create hanota.c

* 新增binary_search_recur.c

* Update vector.h

* Delete codes/c/chapter_divide_and_conquer directory

* Create hanota.c

* Update vector.h

* Update hanota.c

* Create CMakeLists.txt

* Update vector.h

* Update hanota.c

* RollBack vector.h

* Update CMakeLists.txt

* Update hanota.c

* Update hanota.c
2023-10-07 08:30:12 -05:00
王作勋
1f512b105f
refactor: Extend vector.h implementation (#818)
* Update vector.h

增加功能列表:
获取向量的第 i 个元素
设置向量的第 i 个元素
向量扩容
向量缩容
向量插入元素
向量删除元素
向量交换元素
向量是否为空
向量是否已满
向量是否相等
对向量内部进行排序(升序/降序)
对向量某段数据排序(升序/降序)

* Create hanota.c

* 新增binary_search_recur.c

* Update vector.h

* Delete codes/c/chapter_divide_and_conquer directory

* Update vector.h

* Create binary_search_recur.c

* Delete codes/chapter_divide_and_conquer directory

* Update vector.h

* Update vector.h
2023-10-07 00:43:30 -05:00
krahets
4355f8d49f Several bug fixes. 2023-10-04 02:30:31 +08:00
krahets
98538b924f Several bugs fixes and improvments; 2023-10-01 19:33:53 +08:00
易春风
e8bf5879b0
fix: the rust variable should have a snake case name (#811) 2023-09-29 08:37:02 -05:00
易春风
5b692968a9
feat: add for-loop-recur rust codes (#803) 2023-09-28 23:17:05 -05:00
花无缺
191330e73a
feat: Add C code for the section of intro to DP (#771)
* Add dynamic programming C language code

* Add dynamic programming chapter C language code

* Modifying errors in files
2023-09-25 22:11:08 -05:00
Flamingo
22be495412
fix(cpp). update hash_map (#800)
* fix(cpp). update hash_map

遍历 map 还是 k-v 键值对

* Update hash_map.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-25 22:07:14 -05:00
liuyuxin
e3366363b6
feat(dart): add forLoopRecur and update HashMapOpenAddressing (#802)
* feat(dart): add forLoopRecur

* feat(dart): update HashMapOpenAddressing
2023-09-25 22:04:13 -05:00
krahets
e567d08348 Bug fixes 2023-09-26 10:57:53 +08:00
nuomi1
72f243eec3
feat(Swift): update min_cost_climbing_stairs_dp and hash_map_open_addressing (#792) 2023-09-24 09:50:09 -05:00
krahets
ff8e7ceec5 Several bug fixes. 2023-09-24 20:38:21 +08:00
krahets
e3773b7f76 Several bug fixes and improments. 2023-09-24 19:35:32 +08:00
jmin
26bf0c5a78
feat: Add javascript and typescript code in chapter_computational_com… (#780)
* feat: Add javascript and typescript code in chapter_computational_complexity

* docs: Update code comment

* style: update code order th same with java
2023-09-24 03:17:19 -05:00
易春风
4b5e21d0d9
refactor: update the hash_map_open_addressing rust codes to synchronize with java (#787) 2023-09-24 03:16:06 -05:00
Reese Wellin
a6a1036dc9
fix(JS, TS): chapter_sorting QuickSortMedian and QuickSortTailCall example (#785) 2023-09-24 03:14:28 -05:00
hpstory
29c5ff4a8f
feat(csharp): add forLoopRecur and new HashMapOpenAddressing (#783) 2023-09-23 14:15:23 -05:00
Justin Tse
2f727d895d
Fix JS and TS sort bugs (#784) 2023-09-23 14:14:44 -05:00
krahets
1067f30fe7 Include glightbox plugin enabling zooming figures 2023-09-22 13:08:21 +08:00
xianii
d225b416cf
feat: add C code in chapter_greedy (#755)
* add fractional_knapsack.c

* update CMakeLists

* add c code in chapter_greedy

* fix header format

* format code by clang-format

* remove extra comments

* replace ternary operator to MACRO

* parameters form adjustment

* Update fractional_knapsack.c

* Update max_capacity.c

* Update max_product_cutting.c

* add comments for consistency with cpp ver

* move MIN&MAX macro to source file

* typo fix

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-21 07:52:11 -05:00
Yudong Jin
a46b482951
Refactor the hash_map_open_addressing implementation with lazy reallocation. (#776) 2023-09-21 04:43:15 -05:00
lyl625760
45e20e57a1
fix: Update hash_map_open_addressing.java (#727)
* FixBug:Update hash_map_open_addressing.java

1. put keyA, hashFunc 在位置 5
2 put key B, hashFunc 在位置  5. 和 A冲突,插入位置6
3. remove keyA,位置5removed
4. put keyB, hashFunc 在位置  5. 没有冲突,插入位置5
5. remove keyB, 位置5removed
6. get keyB, 此时会出bug,会访问到位置6. 实际上应为keyB 已经删除了

* Update hash_map_open_addressing.java

* Update hash_map_open_addressing.java

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-21 04:39:21 -05:00
krahets
8effa58a59 Several bug fixes. 2023-09-20 01:53:44 +08:00
gonglja
53d91db10d
Fix unreleased memory error (#769)
* 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

* fix(array.c): Fix unreleased memory error

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-19 23:53:45 +08:00
gonglja
bd740b0466
Fix linkedlist queue print error (#770)
* 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

* fix(linkedlist_queue.c): Fix linkedlist_queue.c print error

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-19 23:53:01 +08:00
krahets
9f59c572b5 fine tune 2023-09-17 01:13:15 +08:00
krahets
cb9c14f5ff fix build_tree, binary_search_tree.cs
fix two figures
2023-09-15 02:08:09 +08:00
xianii
af2aeb0897
Remove duplication in cmake (#756)
* remove duplication in cmakelists

* Update CMakeLists.txt

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-14 03:39:22 +08:00
krahets
d190dbf3c1 Several enhancements and fixes 2023-09-14 03:36:31 +08:00
malone6
a9d70e9e4b
fix: raise error in peek() function of linkedlist_stack.py, linkedlist_queue.py, linkedlist_deque.py (#754)
* fix: linkedlist_stack.py 中的peek方法需要判空raise Error

栈空的时候不能再 peek() 。另外由于 pop() 复用了 peek() ,栈空时返回的 None 会传递到 pop() 中的 num ,导致后续的继续执行 
 self.peek.next 报错等后续问题

* Update linkedlist_stack.py

* Update linkedlist_queue.py

* Update linkedlist_deque.py

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-14 01:22:53 +08:00
MwumLi
01732cc14f
feat: add c codes for iteration (#735)
Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-13 03:13:55 +08:00
malone6
9b8625d741
Sync the while loop in iteration.cs with other languages (#746) 2023-09-13 03:06:40 +08:00
keshida
d5bac12f60
fix: modify a function name in array_stack.js(ts) and array_queue.js(ts) (#739)
* Update array_stack.js

判空函数名称有歧义

* Update array_stack.js

* Update array_queue.js

* Update array_stack.ts

* Update array_queue.ts

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-13 03:00:39 +08:00
gonglja
4a923f5a86
Fix insert function in mylist.c (#747)
* 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

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-13 02:50:43 +08:00
krahets
5f814d6538 Add comparison between iteration and recursion.
Fix the figure of tail recursion.
Fix two links.
2023-09-12 00:56:59 +08:00
krahets
2b54352bec prepare 1.0.0b5 release 2023-09-10 23:11:50 +08:00
gonglja
63efe61e56
Add interation.c recursion.c simple_hash.c binary_search_edge.c binary_search_insertion.c in C codes. (#731)
* 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.

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-09 19:16:15 +08:00
gonglja
fb301b5767
Fix print error (#729)
* 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.

* fix(codes/cpp/chapter_greedy): Fix print error.

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-09 16:42:33 +08:00
gonglja
46d6463883
Remove unnecessary printing (#733)
* 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.

* style: Remove unnecessary print.

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-09 16:42:04 +08:00