* 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>
* 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>
* 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>
* Quality of life update
FIX: added namespace math, changed for a weird for loop to a while loop with a better conditional and I initiation
CHORE: Cleaned documentation and added details plus links. removed the invalid cout lines in test for one line.
* Update math/check_factorial.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* Update math/check_factorial.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* Update math/check_factorial.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
* Update math/check_factorial.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update math/check_factorial.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update math/check_factorial.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update math/check_factorial.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update math/check_factorial.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* chore: apply suggestions from code review
* Updated last return in is_factorial
* Update math/check_factorial.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
---------
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
* fix: make N_bonacci return an array of size m
* tests: simplify test, add new test cases
* style: remove unused include, update include justifications
* fix: cover the case n == 0
* fix: fit euler's totient to the contribution guidelines.
* Update math/eulers_totient_function.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update math/eulers_totient_function.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* fix: add more tests
notes: i should have added euler's number first
* fix: revert description
* Update math/eulers_totient_function.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update math/eulers_totient_function.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* chore: apply suggestions from code review
* chore: apply suggestions from code review
---------
Co-authored-by: David Leal <halfpacho@gmail.com>
* added log code for counting digits
* one space removed
* fix: CI warnings (hopefully)
* fix: revert for now
* decoupled test functions
* Update math/finding_number_of_digits_in_a_number.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update math/finding_number_of_digits_in_a_number.cpp
typo changes
Co-authored-by: David Leal <halfpacho@gmail.com>
* uint64_t changed to double to resolve clang-tidy warnings
* clang-format and clang-tidy fixes for 61bb2dea
* comment improvement
* clang-format and clang-tidy fixes for 39ebc33d
* guarded required function
---------
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
* Added aliquot_sum.cpp
* Fixed indentation and changed argument to ull int
* Fixed type of I
* Made parameter as const
* Made some required changes
* Added changes due to namespace
* Formatting changes
Co-authored-by: David Leal <halfpacho@gmail.com>
* fix: power_of_two algorithm redundant conditional 'else'
* feat : add modular_inverse_simple
* updating DIRECTORY.md
* fix : according lint rules
* fix : removed macro and initialize variable aux
* fix: remove namespace std like default
* feat : add unsigned type for block negative number and improving description
* fix: defined in header <cstdint> for use uint64_t type
* fix: improving descriptive comments
* fix: remove redundant lib
* fix: improvinf "brief" and "details" acording suggestion in review
* fix: improving descrition of function imod acording suggestion in review
* fix: improving descrition acording suggestion in review
* Update modular_inverse_simple.cpp
* Apply suggestions from code review
* clang-format and clang-tidy fixes for 768a99c8
* Apply suggestions from code review
* Apply suggestions from code review
* updating DIRECTORY.md
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
* fix: rewrite prime numbers using linear sieve
* fix code scanning error
* clang-format and clang-tidy fixes for 0afd463b
* fix sign-compare warning
* clang-format and clang-tidy fixes for 6ddff0f7
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* feat: added math/area.cpp
* feat: added surface area of sphere, cube and cylinder
* docs: modified @brief
* feat: changed to template functions
* test: added 2 test cases for square_area()
* test: added 3rd test case
* [test/docs] added more test cases and docs for them
* docs: added @details
* updating DIRECTORY.md
* fix: changed from math.h to cmath
Co-authored-by: David Leal <halfpacho@gmail.com>
* feat: added algorithms to the math namespace
Co-authored-by: David Leal <halfpacho@gmail.com>
* fix: call functions from the math namespace for testing
* fix: style indentation
Co-authored-by: David Leal <halfpacho@gmail.com>
* fix: style indentation
Co-authored-by: David Leal <halfpacho@gmail.com>
* feat: uses uint16_t instead of int for testing
* docs: added comments for testing variables
* fix: style guide
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
* Create reverse_binary_tree.cpp
* Added documentation
Added Documentation for the level_order_traversal() function, and implemented a print() function to display the tree to STDOUT
* Added documentation
* Renamed tests to test
* Fixed issue with incorrect using statement
* updating DIRECTORY.md
* clang-format and clang-tidy fixes for fb86292d
* Added Test cases
* Update operations_on_datastructures/reverse_binary_tree.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update operations_on_datastructures/reverse_binary_tree.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update operations_on_datastructures/reverse_binary_tree.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update operations_on_datastructures/reverse_binary_tree.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update operations_on_datastructures/reverse_binary_tree.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* Changed int to int64_t
* Updated documentation wording
* Fixed wrong integer type
Changed int64_t to int32_t
* clang-format and clang-tidy fixes for 2af706b1
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
* updated the code to make it more efficient
* Update math/check_prime.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* Update math/check_prime.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
* Apply suggestions from code review
Co-authored-by: David Leal <halfpacho@gmail.com>
* feat: Add monte carlo integration
* test: Add tests for monte carlo integration
* docs: Add documentation for monte carlo integration
* updating DIRECTORY.md
* fix: Add _USE_MATH_DEFINES for windows
* fix: Comment spacing
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
* Finding no. of digits in a Number
* Initialize n
* Initialize n as int
* Changes done
* Changes done with codes by adding more comments
* Changes done with codes by adding name as md
* Modified comments
* add void
* remove void & update comments
* Set some changes to pass Awesome CI Workflow
* add return 0 & file name in lower case
* Changes done..
* Update finding_number_of_Digits_in_a_Number.cpp
* Update finding_number_of_Digits_in_a_Number.cpp
* Update finding_number_of_Digits_in_a_Number.cpp
* formatting filenames 0ec45e33
* updating DIRECTORY.md
* clang-format and clang-tidy fixes for 0ec45e33
* clang-format and clang-tidy fixes for 9c0a437e
* updating DIRECTORY.md
* Wrote test, needs review
* [fix/docs]: Fix tests/code and add documentation
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>