Commit Graph

1703 Commits

Author SHA1 Message Date
realstealthninja
a71fa6d02f fix: compilation error in catalan numbers 2024-10-01 22:05:00 +05:30
realstealthninja
382e9b25ea chore: bump c++ version to 17 and add justification
Arm supports c++ 17
Esp32 supports c++ 23
decision was made to be 17 because it seemed to offer the best combatability
2024-10-01 22:03:47 +05:30
realstealthninja
4e524dfd34 revert: bump CXX standard to 20 2024-10-01 21:32:44 +05:30
realstealthninja
e3ae1d1a45 chore: bump CXX standard to 20 2024-10-01 21:30:30 +05:30
realstealthninja
8ed74c6409 fix: add an include for functional in catalan_numbers 2024-10-01 21:24:36 +05:30
realstealthninja
939ca4a6a1 fix: init of transform_reduce in dynamic_programming 2024-10-01 21:20:36 +05:30
realstealthninja
2b4084191a fix: add dynamic_programmin, greedy_algorithms, range_queries and operations_on_datastructures subdirectories to cmakelists.txt 2024-10-01 21:01:34 +05:30
realstealthninja
c98fe80f9f fix: add cmakelists to range_queries 2024-10-01 21:00:42 +05:30
realstealthninja
3a442a0a11 fix: add cmakelists to operations_on_datastructures 2024-10-01 21:00:29 +05:30
realstealthninja
b6ac2537b8 fix: add cmakelists to greedy_algorithms 2024-10-01 21:00:15 +05:30
realstealthninja
79dd912cd1 fix: add cmakelists to dynamic programming 2024-10-01 20:59:58 +05:30
realstealthninja
ed217d71db chore: add cache and build comment to git ignore 2024-10-01 20:59:39 +05:30
Piotr Idzik
f789e3bb9e style: cleanup catalan_numbers.cpp (#2740)
* style: cleanup `catalan_numbers.cpp`

* docs: update file level docs

* style: use `std::transform_reduce`
2024-09-29 19:24:02 +05:30
Piotr Idzik
9374b00319 style: add missing const in median_search2.cpp (#2734) 2024-09-17 21:54:35 +05:30
Piotr Idzik
a0b7dee79e style: lint huffman.cpp (#2733) 2024-09-15 14:24:44 +05:30
Piotr Idzik
8df7a884f5 fix: remove memory leak from circular_queue_using_linked_list.cpp (#2731) 2024-09-14 05:09:03 +05:30
Monalisa0311
920b6d4e81 Added test cases in greedy_algorithms\kruskals_minimum_spanning_tree.cpp (#2727)
* Added test cases in greedy_algorithms\kruskals_minimum_spanning_tree.cpp

* Update kruskals_minimum_spanning_tree.cpp

test case1 & 2 changed

* Update kruskals_minimum_spanning_tree.cpp

test-case1 changed

* Update kruskals_minimum_spanning_tree.cpp

All test case formatting changes

* Update kruskals_minimum_spanning_tree.cpp

unit-32 test case added

* Update kruskals_minimum_spanning_tree.cpp

added new line

* Update kruskals_minimum_spanning_tree.cpp

Formatting changed

* Update kruskals_minimum_spanning_tree.cpp

move infinity valued inside test

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-09-13 12:23:29 +05:30
Piotr Idzik
b169269c94 fix: remove memory leak from reverse_binary_tree.cpp (#2730) 2024-09-13 08:02:43 +05:30
Piotr Idzik
7828b8e238 fix: memory leak in morrisinorder.cpp (#2729) 2024-09-12 05:00:09 +05:30
Piotr Idzik
d74f4d33ea fix: memory leak in huffman.cpp (#2728) 2024-09-11 06:55:42 +05:30
Piotr Idzik
15e3fed924 style: add missing const in bloom_filter.cpp (#2724)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-09-05 05:24:16 +05:30
Sebastian Skonieczny
ef209dfab3 Added Iterative Quick Sort (#2684)
* feat: Added iterative quick sort using stack

* fix: Forgot to add @param for sort function

* Update sorting/quick_sort_iterative.cpp

* Update sorting/quick_sort_iterative.cpp

* Update sorting/quick_sort_iterative.cpp

* style: space b/w for and comment

* Update sorting/quick_sort_iterative.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update sorting/quick_sort_iterative.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* fixed namespace error

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-09-05 05:14:41 +05:30
Piotr Idzik
490974eeb3 fix: memory leak in median_search2.cpp (#2723) 2024-09-04 05:31:30 +05:30
Piotr Idzik
c652c4f237 fix: stack buffer underflow in tim_sort.cpp (#2722) 2024-09-03 17:14:49 +05:30
Piotr Idzik
b6108e494d fix: remove memory leak from recursive_tree_traversal.cpp (#2721) 2024-09-02 18:12:26 +05:30
Maxim Smolskiy
db182d5521 fix: fix bug in timSort (#2692)
* fix: fix bug in timSort

* Apply suggestions from code review

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Fix

* Update sorting/tim_sort.cpp

* Add const

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-09-02 04:42:33 +05:30
Piotr Idzik
52db277fb6 fix: remove memory leak from iterative_tree_traversals.cpp (#2720) 2024-09-02 04:33:19 +05:30
SOZEL
54a20b447e Rework on Stack Array Data Structure (#2683)
* ref: rework on stack array data structure
- The `Stack` class is placed within the `data_structures` namespace
- The destructor is added to the Stack class to ensure memory deallocation
- Comments are added to the member functions to describe their purpose
- The self-test function is provided, which demonstrates the usage of the Stack class

* chore(docs): add `namespace` docstring

* chore: add `std::out_of_range` exception and test cases when stack is empty

* ref: add `full` and `empty` methods

* ref: improve stack array implementation
- Use TOS instead of stack index
- Add tests for overflow and underflow

* fix: remove comparision to true from asserts

* chore: remove `stack.hpp`

* fix: revert

* Update data_structures/stack_using_array.cpp

* docs: add namespace comment

* chore: remove redundant line in docstring of `empty` method

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-09-01 10:07:27 +05:30
github-actions[bot]
fe41cf4d11 docs: update DIRECTORY.md (#2718)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-09-01 09:54:27 +05:30
Yancey
502a953e23 feat: let KMP algorithm return index (#2713)
* fix: KMP algorithm (#2712)

* feat: let the KMP algorithm return index and add more tests.

* feat: format code

* Update strings/knuth_morris_pratt.cpp

* update knuth_morris_pratt.cpp

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-09-01 09:47:49 +05:30
SOZEL
9702903a12 Implement Trapped RainWater (#2716)
* chore: add `trapped_rainwater.cpp` to DIRECTORY.md

* feat: implement Trapped Rain Water algorithm

* chore: add links to the trapped rain water problem

* chore(docs): remove Trapped Rain Water dir

* ref: add edges tests

* doc: adding Sozel as author

* doc: includes documentatino

* ref: use `unsigned int` for height of walls

* fix: use fixed-width integers instead of unsigned int

* chore: rearrange included libraries

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-08-31 15:08:24 +05:30
Ikko Eltociear Ashimine
1d692227dc refactor: fix typo in neural_network.cpp (#2689)
intialize -> initialize

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-08-31 09:35:55 +05:30
David Leal
c84c7da30f [fix/docs]: improve the Jump Game algorithm (#2514)
* [fix/docs]: improve the Jump Game algorithm

* fix: pass `index` by reference and `const` it

* fix: use previous algorithm

* chore: apply suggestions from code review

Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
Co-authored-by: Piotr Idzik <vil02@users.noreply.github.com>

---------

Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
Co-authored-by: Piotr Idzik <vil02@users.noreply.github.com>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-08-31 06:53:37 +05:30
Maxim Smolskiy
1f5828eadf fix: fix deprecation warning for macOS (#2711)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-08-31 06:35:53 +05:30
Tim Lander
4a03c62dd3 Fix compilation failure with gcc >= 13 (#2702)
For testing - https://godbolt.org/z/6WWh3zs9G

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-08-31 06:25:29 +05:30
Piotr Idzik
af72fab013 fix: make interface of NCRModuloP fail-safe (#2469)
* fix: set proper size of fac

* style: use std::size_t as a type of loop counter

* style: use uint64_t as a type of loop counter

* fix: remove p from the argument list of NCRModuloP::ncr

* refactor: add utils namespace

* refactor: use references in gcdExtended

* refactor: add NCRModuloP::computeFactorialsMod

* style: make NCRModuloP::ncr const

* test: reorganize tests

* test: add missing test cases

* refactor: simplify logic

* style: make example object const

* style: use auto

* style: use int64_t to avoid narrowing conversions

* docs: update explanation why to import iostream

* docs: remove `p` from docstr of `NCRModuloP::ncr`

* docs: udpate doc-strs and add example()

* Apply suggestions from code review

Co-authored-by: David Leal <halfpacho@gmail.com>

* dosc: add missing docs

* feat: display message when all tests pass

Co-authored-by: David Leal <halfpacho@gmail.com>

* style: initialize `NCRModuloP::p` with `0`

Co-authored-by: David Leal <halfpacho@gmail.com>

---------

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-08-31 06:12:39 +05:30
Piotr Idzik
8bde3ea612 fix: remove memory leak in sublist_search.cpp (#2541)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-08-31 06:07:42 +05:30
Piotr Idzik
7fc338d0fd fix: use GITHUB_ACTOR in git config (#2673) 2024-08-31 06:03:44 +05:30
Piotr Idzik
519d37f6bc fix: remove memory issues (#2533)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-08-30 23:42:15 +05:30
Piotr Idzik
9e44b68070 fix: remove memory leak (#2532)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-08-30 23:35:30 +05:30
realstealthninja
435f1eded4 chore: Make CI builds parallel (#2714)
* chore: make ci builds parallel

* chore: fix specification of job number

* chore: use 4 as a limit for parallel builds

* fix: remove parallel from linting
2024-08-30 23:07:19 +05:30
Piotr Idzik
e139ee952f fix: add and use function deleteList to remove memory leak (#2534)
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-08-30 23:00:06 +05:30
Piotr Idzik
8a368240e2 fix: remove memory leak iterative_factorial.cpp (#2535)
* fix: remove memory leak

* tests: check properly if `math::iterativeFactorial` throws
2024-08-30 22:50:08 +05:30
David Leal
2dadbf73f4 chore: remove unnecessary prints in games/memory_game.cpp 2024-02-12 20:03:19 +00:00
David Leal
08900b8c98 chore: update copyright notice to 2024 2024-01-15 20:02:44 -06:00
Piotr Idzik
6cd283950b chore: update actions/checkout to v4 (#2530) 2024-01-15 19:38:58 -06:00
David Leal
6376bf46af chore: add workflow_dispatch in directory workflow 2023-09-27 12:34:55 -06:00
David Leal
23b133ae1e fix: GitHub Actions bot username on Awesome Workflow 2023-09-06 11:37:12 -06:00
github-actions[bot]
f49369065c docs: update DIRECTORY.md (#2521)
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
2023-09-06 11:35:38 -06:00
David Leal
6daf7015e3 chore: run directory workflow daily 2023-08-04 15:06:36 -06:00