Commit graph

16 commits

Author SHA1 Message Date
yishangzhang
fc63e990c8
fix: Object pointer not deleted (#662)
* fix: Object pointer not deleted

*  codes/cpp/chapter_hashing

Signed-off-by: yishangzhang <zhangyi2017@cug.edu.cn>

* Update hash_map_chaining.cpp

---------

Signed-off-by: yishangzhang <zhangyi2017@cug.edu.cn>
Co-authored-by: Yudong Jin <krahets@163.com>
2023-07-29 02:08:00 +08:00
Yudong Jin
2b7d7aa827
Add the chapter of greedy. (#633)
Add the section of fractional knapsack.
2023-07-20 18:26:54 +08:00
krahets
54dc288e61 1. Remove Pair class from hash coliision code.
2. Fix the comment in my_list code.
3. Add a Q&A to the summary of sorting.
2023-06-26 23:06:15 +08:00
Yudong Jin
1b1af8d038
Add Java and C++ code for the section hash algorithm (#560) 2023-06-21 19:26:16 +08:00
Yudong Jin
9563965a20
Add the codes of hashmap (#553)
of chaining and open addressing
2023-06-14 02:01:06 +08:00
krahets
145975b335 Rename the common modules in Java, C++ and C. 2023-04-24 04:11:18 +08:00
Gonglja
8bc41bc013
Add space_complexit under C and fix memory leak under CPP (#456)
* 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)

* fix(codes/cpp): Fix memory leaks: replace pointers with local variables, no need to manage memory

* fix(codes/cpp): Fix memory leaks: no delete

* fix(codes/cpp): Fix memory leaks: Add destructor ~ArrayHashMap()

* Update PrintUtil.hpp

* feat(codes/c): Add three-party hash implementation

* feat(codes/c): Add freeMemoryTree in tree_node.h

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

* styles(codes/c): Modify format

* feat(codes/cpp): Undo a previous delete, there is no memory leak here

* Update array_hash_map.cpp

* Update include.h

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-04-15 23:51:35 +08:00
krahets
9c9c8b7574 Format C++ codes in Clang-Format Style: Microsoft 2023-04-14 03:44:02 +08:00
krahets
518b9efabc Update a comment in array_hash_map 2023-03-15 03:48:31 +08:00
krahets
d5afd93571 Update array_hash_map 2023-03-15 03:11:43 +08:00
Gonglja
567497a6b8
Add cpp codes cmake build method (#419)
* feat(codes/cpp): Add cmake build method

* feat(codes/cpp): Modify the cpp support version to c++17

* feat(codes/cpp): fix graph_adjacency_list.cpp cannot be compiled into an executable

* style(codes/cpp): Adjust the code to enhance compatibility.

* feat(codes/cpp): Change cpp version from 17 to 11.
2023-03-14 20:40:33 +08:00
krahets
0407cc720c Fix Repo 2023-02-08 04:17:26 +08:00
Yudong Jin
0e49f0053a Update the format of the file headers
of c, cpp, java, js, ts, swift.
2023-01-06 03:39:19 +08:00
Yudong Jin
c071ab88d2 Update hash map 2022-12-15 23:08:07 +08:00
machangxin
1229f98e92 Fixed some problems, indentation and Pointer 2022-12-15 09:43:20 +08:00
machangxin
aeb4e6077d Add C++, Python, Go code for chapter_hashing 2022-12-14 17:18:32 +08:00