C-Plus-Plus
C-Plus-Plus copied to clipboard
Collection of various algorithms in mathematics, machine learning, computer science and physics implemented in C++ for educational purposes.
#### Description of Change There are several problems with the current implementation of [`counting_sort.cpp`](https://github.com/TheAlgorithms/C-Plus-Plus/blob/23b133ae1eac4ad7e94e74da140d462180738413/sorting/counting_sort.cpp): - memory allocated by creating `*Count` is _uninitialized_ and not deleted, https://github.com/TheAlgorithms/C-Plus-Plus/blob/23b133ae1eac4ad7e94e74da140d462180738413/sorting/counting_sort.cpp#L29 - memory allocated by...
#### Description of Change [`get_size_of_linked_list.cpp`](https://github.com/TheAlgorithms/C-Plus-Plus/blob/23b133ae1eac4ad7e94e74da140d462180738413/operations_on_datastructures/get_size_of_linked_list.cpp) has a memory leak. This PR adds the function `deleteList` in order to fix it. #### Checklist - [x] Added description of change - [x]...
#### Description of Change In this Pull Request I provide an implementation for the Boruvka algorithm for finding minimum spanning trees. I also provide a test function and a code-block...
#### Description of Change There is a memory leak in [`iterative_factorial.cpp`](https://github.com/TheAlgorithms/C-Plus-Plus/blob/23b133ae1eac4ad7e94e74da140d462180738413/math/iterative_factorial.cpp) while throwing an exception. This PR fixes it and does some other small changes. #### Checklist - [x] Added...
#### Description of Change [`sublist_search.cpp`](https://github.com/TheAlgorithms/C-Plus-Plus/blob/23b133ae1eac4ad7e94e74da140d462180738413/search/sublist_search.cpp) has a memory leak. This PR adds the function `deleteList` in order to fix it. #### Checklist - [x] Added description of change - [x]...
Fixed finding the middle of the segment. Now if "a" and "b" fit into the double type, then the middle too. In the previous implementation, there could be an exit...
#### Description of Change #### Checklist - [x] Added description of change - [x] Added file name matches [File name guidelines](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md#New-File-Name-guidelines) - [x] Added tests and example, test must pass...
This C++ code defines a simple linked list and provides various operations on it through a LinkedList. This implementation leverages object-oriented programming principles, utilizing a class-based approach to manage the...
#### Description of Change #### Checklist - [ ] Added description of change - [ y] Added file name matches [File name guidelines](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md#New-File-Name-guidelines) - [ y] Added tests and example,...
### Detailed description How about an Aho-Corasick algorithm? ### Context It is about O(1) searching. ### Possible implementation _No response_ ### Additional information aho-corasick - https://en.m.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm