Commit graph

15 commits

Author SHA1 Message Date
gonglja
8f5ef68c65
feat: Add C codes for the chapter backtracking (#593)
* 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

* feat(codes/c): Add part of the c code in the backtracking chapter

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

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

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

* style(codes/c): Adjust the format

* feat(codes/c): Add memory release in chapter_backtracking

* fix(codes/c): Fix memory release issue.

* style(codes/c): Update format and Merge duplicate code

* style(code/c): Change print format in preorder_traversal_iii_template.c

* Update preorder_traversal_iii_template.c

* Update permutations_i.c

* feat(codes/c): Remove myArray, use public vector.

* feat(codes/c): Add subset_sum_i_naive.c in C codes.

* feat(codes/c): Add permutations_i in CMakeLists.txt

* feat(codes/c): Update printf function in vector.h.

* feat(codes/c): Add subset_sum_i.c and subset_sum_ii.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-07-29 15:14:01 +08:00
NI-SW
c36010b324
add C code for graph (#583)
* Create chapter_graph

* Delete chapter_graph

* add C code for graph

* add C code for graph

* Create graph_adjacency_list.c

add C code for graph

* Update CMakeLists.txt

* Update format and output

* Update format and output

* Update format and output

* Update format and output

* Update format and output

* Update format and output

* Update format and output

* Update format and output

* Update format and output

* Update format and output

* Update format and output

* Update format and output

* Update format and output

* Update format and output

* Update format and output

* Update graph_adjacency_list.c

* Update CMakeLists.txt for c code of graph

* Update format of c code

* Update format of c code

* Update format of c code

* Update verticesList

Change the data structure of the storage list from a linked list to a linear table

* Update graph_adjacency_list.c

* Update graph_adjacency_matrix.c

* Create graph_adjacency_list_test.c

* Create graph_bfs

* Update CMakeLists.txt

* Update graph_adjacency_list.c
2023-07-11 23:50:51 +08:00
krahets
d3e597af94 Update cmakelists.txt 2023-06-13 21:16:54 +08:00
gonglja
86209e0a7b
feat: Add C codes for bucket sort, heap sort, selection sort, binary search edge (#525)
* 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

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-06-02 02:51:35 +08:00
krahets
d3cc149c5a Merge the chapter of binary tree and searching. 2023-05-21 19:26:52 +08:00
krahets
145975b335 Rename the common modules in Java, C++ and C. 2023-04-24 04:11:18 +08:00
Guanngxu
95ed93dc4b
feat: add C array hash map (#424)
* feat: add C hash map

* fix: hash map put bug

* fix: C array hash map

* fix: Incorrect indentation

* refactory array hash map

* remove header

* refactory print

* 修改注释

* replace all the Tab with 4 spaces

* 向 cpp 靠拢

* 删除错误注释

* delete <stdlib.h>

* delete array_hash_map.h

* Update array_hash_map.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-04-23 23:44:49 +08:00
krahets
6723cdbc7e Represent null with INT_MAX in C, C++. 2023-04-18 14:31:23 +08:00
Yudong Jin
881d573790
Refactor the articles related to searching algorithm. Add the chapter of binary search. Add the section of searching algorithm revisited. (#464) 2023-04-17 18:22:18 +08:00
gonglja
28fdd26f2f
Fix some errors of cmake build and add hashing_search.c (#458)
* 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

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-04-17 13:37:38 +08:00
Yudong Jin
a0990a0f7a
Merge branch 'master' into master 2023-01-18 19:14:38 +08:00
reanon
c8ee075d50 feat(heap): add c codes 2023-01-16 10:03:31 +08:00
Gonglja
153846c94b feat(codes/c/): add array_stack and linkedlist_stack frame 2023-01-12 21:09:51 +08:00
reanon
8723ca1469 feat(tree): add C codes 2023-01-11 01:56:08 +08:00
reanon
24cdcd54df feat(codes/c): add C include/ codes and modify exist C codes 2023-01-11 00:55:21 +08:00