1183 Commits

Author SHA1 Message Date
c338a6d8d8 Add the section of bucket sort 2023-03-26 04:47:05 +08:00
22898b6955 Simplify the contents of the sorting algorithms. 2023-03-25 18:41:22 +08:00
9b0bdd929f feat: add C merge sort (#434)
* feat: add C merge sort

* Update merge_sort.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-03-23 19:10:33 +08:00
0a4a846e13 Fix python modules 2023-03-23 18:56:14 +08:00
8918ec9079 refactor: Follow the PEP 585 Typing standard (#439)
* Follow the PEP 585 Typing standard

* Update list.py
2023-03-23 18:51:56 +08:00
f4e01ea32e Update counting_sort.md 2023-03-23 04:41:08 +08:00
326a56fdd9 Add the overview figure of counting sort. 2023-03-23 04:21:01 +08:00
31be65cc55 refactor: use stride (#437) 2023-03-23 02:57:31 +08:00
5ba85ea69d feat: add Swift codes for counting_sort article (#438) 2023-03-23 02:57:13 +08:00
65e47b0748 Add Python and C++ code for the counting sort. (#436) 2023-03-21 22:24:17 +08:00
6d452777a4 Update graph.md 2023-03-20 21:46:27 +08:00
a78365401e Update counting_sort.go and radix_sort.go 2023-03-20 21:40:50 +08:00
b9e97d3823 Fix access error when printArray(arr, 0) (#432)
* 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

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-03-20 21:26:20 +08:00
e539c44f63 feat: add C counting_sort (#430)
* feat: add C counting_sort

* Update CMakeLists.txt

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-03-20 21:25:03 +08:00
0659c54e77 Fix memory leaks (#433)
* 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
2023-03-20 21:17:19 +08:00
c837882dbd feat(counting_sort): support counting_sort in c/go (#431)
* feat(go/counting_sort): support counting_sort in go

* feat(test): support counting_sort_naive testcase

* feat(go/counting_sort): support counting sort

* feat(c/counting_sort): support counting_sort in c
2023-03-20 21:16:25 +08:00
ecc718d0b1 Update build_heap.md 2023-03-20 21:10:01 +08:00
2356cc1b2e add C binary_search and linear_search (#426)
* add C binary_search

* add C linear_search

* Update linear_search.c

* Update binary_search.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-03-20 19:17:20 +08:00
501502662c Update quick_sort.md 2023-03-20 03:14:21 +08:00
564ace6bc1 feat(codes/c): Add linkedlist_deque.c (#422)
* feat(codes/c): Add linkedlist_deque.c

* feat(codes/c): Update linkedlist_deque.c function comment.

* feat(codes/c): Update linkedlist_deque.c driver code.
2023-03-19 23:48:46 +08:00
3173d02538 fix(codes/cpp): Memory leak fix: the space was not freed when pop removed the element. (#423) 2023-03-19 23:46:48 +08:00
ceeb138487 Add the section of counting sort. (#427) 2023-03-19 23:42:12 +08:00
8e78c6036b Update hash_collision.md 2023-03-18 22:48:26 +08:00
3cd724a6d8 Update list_node.h 2023-03-18 18:33:35 +08:00
351da5c108 update C linked_list init (#421)
* docs: update C linked_list init

* Update linked_list.md

* Update linked_list.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-03-18 18:31:47 +08:00
28f3c98697 Fix avl_tree.cpp 2023-03-16 22:50:17 +08:00
0840bc2043 Fix the deconstructor of linkedlist_queue.cpp 2023-03-16 18:43:13 +08:00
fcdc96e03d fix(doc/go): fix binary_tree doc (#420) 2023-03-16 18:42:06 +08:00
06f87d8066 Update README.md 2023-03-16 00:05:46 +08:00
518b9efabc Update a comment in array_hash_map 2023-03-15 03:48:31 +08:00
d5afd93571 Update array_hash_map 2023-03-15 03:11:43 +08:00
669388128f Merge branch 'develop' 2023-03-15 03:10:08 +08:00
9bb8e94a2c Update hash_map and hash_collision. 2023-03-15 03:06:52 +08:00
ec0856ccfa docs(Hashing/Hash_Collision): add go part. (#395)
* docs(Hashing/Hash_Collision): add go part.

* docs(Hashing/Hash_Collision): add go part.

* docs(Hashing/Hash_Collision): add go part.

* docs(Hashing/Hash_Collision): add go part.

* docs(Hashing/Hash_Collision): add go part.

* Update hash_collision.md

* fix context logic question

* Update Go language hash table collision handling to limit each bucket to 8 entries and compare keys' high 8 bits of hash to reduce access to key-value pairs

* Update hash_collision.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-03-15 02:18:07 +08:00
d37d704b18 Update CMakeLists.txt for C++ 2023-03-15 01:43:28 +08:00
c2be6ebfbe 🚀feat: add rust codes for array_deque (#418)
* update zig codes style

* feat: add rust codes for array_deque

* Update array_deque.rs

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-03-14 20:45:27 +08:00
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
d09b1e4f9f Fix space_complexity.md 2023-03-13 22:53:53 +08:00
b37a088f7d Fix a comment in binary_tree_bfs.go 2023-03-13 22:47:22 +08:00
516cb17775 Replace poll with pop 2023-03-13 22:39:45 +08:00
28aacccf44 refactor: Replace 'poll' with 'pop' in Heap (#416) 2023-03-13 22:31:05 +08:00
8aebbaad21 refactor: Replace poll with pop in Queue and Deque (#415) 2023-03-13 21:58:21 +08:00
2d17ee8e92 feat(codes/c): Add array_deque.c (#412)
* feat(codes/c): Add array_deque.c

* Update array_deque.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-03-13 20:40:25 +08:00
f73b6a3654 feat(codes/c): Add linkedlist_queue.c (#413)
* feat(codes/c): Add linkedlist_queue.c

* feat(codes/c): Prevent null pointer access errors in linkedlist_queue.c

* Update linkedlist_queue.c

* Update linkedlist_queue.c

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-03-13 20:37:58 +08:00
be0c965886 feat(go/deque): support go array deque (#414) 2023-03-13 20:16:23 +08:00
6924d15f63 🚀feat: add rust codes for linkedlist_stack, linkedlist_queue and linkedlist_deque (#410)
* feat: add rust codes for space_complexity

* feat: add rust codes for linkedlist_stack

* update

* feat: add rust codes for linkedlist_queue

* feat: add rust codes for linkedlist_deque

* update
2023-03-13 20:15:11 +08:00
9151eaf533 Add typing annotations to Python codes. (#411) 2023-03-12 18:49:52 +08:00
2029d2b939 feat: add rust codes for space_complexity (#409) 2023-03-12 15:16:35 +08:00
82bbdd444d Update the chapter of stack and queue. 2023-03-12 04:14:36 +08:00
050b922f8a feat: add rust codes for linked_list and my_list (#408)
* feat: add rust codes for linked_list

* feat: add rust codes for my_list

* Update linked_list.rs

* Update print_util.rs

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-03-12 02:48:44 +08:00