Commit graph

969 commits

Author SHA1 Message Date
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
gonglja
7483c6ce1e
Fix my_heap.c build error (#732)
* 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/c/chapter_heap): Fix my_head.c build error.

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-09 16:41:24 +08:00
linweibin
c8e0c476bd
增加C的贪心算法代码 (#726) 2023-09-09 16:28:44 +08:00
krahets
f71b2a40da fix preorder_traversal_iii_compact code 2023-09-09 00:51:00 +08:00
Night Cruising
2217ffc447
feat: add rust codes for simple_hash (#724) 2023-09-08 00:38:55 +08:00
XiaChuerwu
180d4982c9
feat: Add C codes for chapter_hashing (#706)
* feat: Add C codes for chapter_hashing

* fix:Make corrections to the formatting

* fix:Fixing Test Cases

* fix:Fixing Test Cases

* fix:revised format

* Update hash_map_chaining.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-08 00:36:49 +08:00
Yudong Jin
9c3b7b6422
Sort the coding languages by applications. (#721) 2023-09-04 03:19:08 +08:00
nuomi1
8d5e84f70a
Feature/chapter greedy swift (#720)
* feat: add Swift codes for greedy_algorithm article

* feat: add Swift codes for fractional_knapsack_problem article

* feat: add Swift codes for max_capacity_problem article

* feat: add Swift codes for max_product_cutting_problem article
2023-09-03 19:09:45 +08:00
krahets
dd72335235 Format C, C++, C#, Go, Java, Python, Rust code. 2023-09-02 23:54:38 +08:00
nuomi1
b6ac6aa7d7
Feature/chapter divide and conquer swift (#719)
* feat: add Swift codes for binary_search_recur article

* feat: add Swift codes for build_binary_tree_problem article

* feat: add Swift codes for hanota_problem article
2023-09-02 23:08:37 +08:00
krahets
978857570f Format JS and TS code. 2023-09-02 23:07:47 +08:00
Justin Tse
f96f583771
Add Chapter greedy for JS and TS code (#718)
* Fix binary_search_tree TS code

* Update binary_search_tree js code style

* Add the JavaScript code for Chapter of Greedy

* Add the TypeScript code for Chapter of Greedy

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-02 20:20:17 +08:00
Justin Tse
89a5f4d0d7
Fix binary_search_tree TS code and update JS code style (#715)
* Fix binary_search_tree TS code

* Update binary_search_tree js code style

* Update binary_search_tree.ts

* Update avl_tree.ts

* Update binary_search_tree.ts

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-02 19:56:23 +08:00
nuomi1
22d1135e04
refactor: remove buildTree (#716) 2023-09-02 19:47:54 +08:00
nuomi1
fd84d4443e
feat: add Swift codes for iteration_and_recursion article (#717) 2023-09-02 19:47:18 +08:00
gaofer
620bfb1f1d
Iteration and recursion code in js/ts (#703)
* feat(JS and TS):add the section of iteration and recursion

* feat(JS and TS):add the section of iteration and recursion

* feat(JS and TS):add the section of iteration and recursion
2023-09-02 16:09:13 +08:00
Night Cruising
3af00d00d7
feat: add rust codes for chapter computational complexity (#714) 2023-09-02 16:08:52 +08:00
hpstory
8a0a8b80cf
feat(csharp): fix binary_search_tree code (#712)
* feat(csharp): fix binary_search_tree code

* Update binary_search_tree.cs

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-08-31 16:59:43 +08:00
liuyuxin
233e842d63
fix dart code for binary_search_tree (#711) 2023-08-31 16:55:16 +08:00
Night Cruising
95bc0ffdb2
Feat: add rust codes for chapter searching (#710) 2023-08-31 02:36:06 +08:00
Night Cruising
d37b795ef2
Fix the bug of wrong function call (#709) 2023-08-31 02:33:13 +08:00
krahets
a47a974a6a fix climbing_stairs_constraint_dp code 2023-08-31 02:31:58 +08:00
krahets
628d8a516b fix binary_search_tree code 2023-08-31 02:31:31 +08:00
gaofer
f7ab4797bf
feat: add dynamic programming code for JS and TS (#692)
* fix: Correcting typos

* Add JavaScript and TypeScript code of dynamic programming.

* fix: Code Style

* Change ==/!= to ===/!==
* Create const by default, change to let if necessary.

* style fix: Delete unnecessary defined type
2023-08-30 15:27:01 +08:00
krahets
63aef4ed08 Fix a figure and latex symbols. 2023-08-30 15:25:03 +08:00
gaofer
1b94b77cbb
Add code in javascript and typescript. (#690)
* Add binary_search_insertion and binary_search_edge code in javascript and typescript.

* code style fix: in FOR loop, use CONST will be nicer.

* fix: Code Style

* Change ==/!= to ===/!==
* Create const by default, change to let if necessary.
* Update import files

* Update codes/javascript/chapter_searching/binary_search_edge.js

Co-authored-by: Justin Tse <xiefahit@gmail.com>

* style fix: Delete unnecessary defined type

---------

Co-authored-by: Justin Tse <xiefahit@gmail.com>
2023-08-30 05:21:47 +08:00
XiaChuerwu
cf0d4b32ec
Added destructor function (#702)
* Added destructor function

* Fixed hash function

* Added hash_map_chaining.c file

* Amendment submission

* Delete hash_map_chaining.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-08-29 20:24:42 +08:00
hpstory
8528ae224e
feat(csharp): add the section of iteration and recursion (#697) 2023-08-28 13:36:41 +08:00
Reanon
20f53e9fc4
feat(go): add iterration/recursion & fix bugs (#698) 2023-08-28 13:35:39 +08:00
liuyuxin
50e17905fd
feat: Add Dart Codes for section_iteration_and_recursion (#696) 2023-08-28 00:50:26 +08:00
krahets
9731a46d67 Fix a definition. 2023-08-27 00:50:18 +08:00
krahets
ae304bd605 Update iteration code. 2023-08-25 02:22:57 +08:00
Yudong Jin
3e64f68ae9
Add the section of iteration and recursion. (#693) 2023-08-24 17:51:41 +08:00
krahets
f524b957d4 Finetune and fix 2023-08-24 17:48:35 +08:00
Reanon
628a274b50
feat(go): support binary search & fix comments (#691) 2023-08-23 21:32:40 +08:00
krahets
f5dda8d99a Polish the content 2023-08-21 03:06:53 +08:00
krahets
2626de8d0b Polish the chapter
introduction, computational complexity.
2023-08-20 14:51:39 +08:00
krahets
c310edb672 Polish the chapter of array and linkedlist 2023-08-17 05:13:19 +08:00
liuyuxin
0858ab91c0
Add missing Dart codes and fix some errors (#689)
* Add missing Dart codes and fix some errors

* Update array_binary_tree.dart

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-08-17 05:04:38 +08:00
Justin Tse
5d7e0a59b1
Add JavaScript and TypeScript code of top_k and update some code style (#686)
* Update JS and TS code style

* Add JavaScript and TypeScript code of top_k

* Update top_k.ts

* Apply suggestions from code review

Co-authored-by: Justin Tse <xiefahit@gmail.com>

* Apply suggestions from code review

Co-authored-by: Justin Tse <xiefahit@gmail.com>

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-08-17 05:00:35 +08:00
liuyuxin
4c75c204f3
feat: Add Dart codes for binary search (#688) 2023-08-14 23:07:20 +08:00
Night Cruising
5a4182372c
Fix the bug of index in rust codes (#685) 2023-08-14 00:54:15 +08:00
krahets
0c18198c01 Fix the figures.
Polish the chapter of data structure.
2023-08-13 19:32:11 +08:00
William Yuan
ec82be7dc2
feat(tree): Add the array representation of the binary tree(js,ts) (#681)
* fix: fixed the bug of arrToTree function

* feat(tree): Add the array representation of the binary tree(js,ts)

* refactor: Make the arrToTree method match the method in java
2023-08-13 19:30:50 +08:00
liuyuxin
10c397b172
feat: Add Dart codes for chapter_dynamic_programming and chapter_greedy (#683)
* feat: Add Dart codes for chapter_dynamic_programming

* feat: Add Dart codes for chapter_greedy
2023-08-13 19:29:54 +08:00