* add conditional probability algorithm
* test: assert error messages, add new line at end of file, improve docs and test descriptions
* Apply self test comment
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* docs: use proper latex syntax probability/conditional_probability.cpp
---------
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* Create check_even_odd.cpp
Implementation to Check if a number is Even or Odd using Bitwise Operator
* Update check_even_odd.cpp
* Create factorial_top_down_dp.cpp
* Delete dynamic_programming/factorial_top_down_dp.cpp
Deleted the one file as there was 2 files in the commit
* Create factorial_top_down_dp.cpp
* Delete dynamic_programming/factorial_top_down_dp.cpp
* Update bit_manipulation/check_even_odd.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* Update bit_manipulation/check_even_odd.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* Update bit_manipulation/check_even_odd.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* Update bit_manipulation/check_even_odd.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* Update check_even_odd.cpp
modified
* Update check_even_odd.cpp
reverted to boolean to check if number is even or not
---------
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* Create check_even_odd.cpp
Implementation to Check if a number is Even or Odd using Bitwise Operator
* Update check_even_odd.cpp
* Create factorial_top_down_dp.cpp
* Delete dynamic_programming/factorial_top_down_dp.cpp
Deleted the one file as there was 2 files in the commit
* Create factorial_top_down_dp.cpp
* Delete bit_manipulation/check_even_odd.cpp
* Update dynamic_programming/factorial_top_down_dp.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* Update dynamic_programming/factorial_top_down_dp.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* Update dynamic_programming/factorial_top_down_dp.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* Update factorial_top_down_dp.cpp
modified
* Update factorial_top_down_dp.cpp
added __uint128_t for handling fixed-width integer types
* Create memoised_factorial.cpp
* Rename memoised_factorial.cpp to factorial_memoization.cpp
* Update factorial_memoization.cpp
* Delete dynamic_programming/factorial_top_down_dp.cpp
deleted the file from dp folder
* Update math/factorial_memoization.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* Update factorial_memoization.cpp
added cstdint header and switched to uint64 Thanks
* fix: wrap factorial functions under math namespace
* chore: add scope specifier in test cases
* doc: add documentation to headers
* doc: add defintion of memoisation as well as rewrite brief
---------
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* feat: add count_paths algorithm with a test case
* fix: updated number_of_paths algorithm, added more test cases, and set unsigned int as parameter
* fix: replaced unsigned int with std::uint32_t for fixed size
* fix: Handled empty graph, invalid input and added test cases for the same
* clang-format and clang-tidy fixes for 80e27baa
---------
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1. Typographical Error in Doxygen Comment
In the Doxygen comment at the beginning of the file, "Merege Sort" should be corrected to "Merge Sort".
2. Merging Logic
In the merge function, the merging logic can lead to out-of-bounds access if both sub-arrays have been completely traversed. The condition in the while loop should ensure that you only access elements of L and R if they are within bounds:
3. Memory Management
Using new and delete[] for the temporary arrays (L and R) is fine, but you can also use std::vector from the C++ Standard Library to simplify memory management:
4. Input Validation
You should consider adding input validation when reading the number of elements and the actual elements to avoid undefined behavior.
5. Main Function Improvements
You can also enhance the main function by encapsulating the input logic in a separate function, improving readability.
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* Update fibonacci_fast.cpp
Modify the fibonacci_fast.cpp to fit the project style requirements.
* Update fibonacci_fast.cpp to meet the revision suggestions.
* Update fibonacci_fast.cpp to try to pass some CI test
* Update fibonacci_fast.cpp
* Update fibonacci_fast.cpp to meet the coding style requirements
* Update fibonacci_fast.cpp
* Update fibonacci_fast.cpp
---------
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* ci: make compile add warnings to file
* chore: use cpp-linter instead of inhouse linter
* chore: use abinoda instead of pullreminders for label-when-approved
* fix: permissions awesome-ci
* fix: permission issue for github action
* ci: make compile add warnings to file
* chore: use cpp-linter instead of inhouse linter
* chore: use abinoda instead of pullreminders for label-when-approved
* fix: permissions awesome-ci
* ci: make compile add warnings to file
* chore: use cpp-linter instead of inhouse linter
* chore: use abinoda instead of pullreminders for label-when-approved