Commit Graph

216 Commits

Author SHA1 Message Date
ewd00010
e3f0551f98
[fix/docs]: fit check_amicable_pair.cpp to guidelines (#2465)
* Quality of life

FIX:  initlized sum to 1 instead of adding it before return
CHORE: cleaned documentation aswell as adding new documentation, namespace math added

* Update math/check_amicable_pair.cpp

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

* Update math/check_amicable_pair.cpp

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

* Update math/check_amicable_pair.cpp

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

* Update math/check_amicable_pair.cpp

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

* clang-format and clang-tidy fixes for bc87fea5

* clang-format and clang-tidy fixes for 0a19d1ad

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
2023-06-23 14:06:42 -06:00
realstealthninja
2fd530cba1
[fix/docs]: fit armstrong_number.cpp to guidelines (#2457)
* fix: fit armstrong_number.cpp to guidelines

* chore: delete unnecessary whitespace

* updating DIRECTORY.md

* fit: aliquot_sum to contribution guidelines

added a math formula

* chore: add print statement mentioning tests have passed

* Update math/armstrong_number.cpp

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

* Update math/armstrong_number.cpp

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

---------

Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2023-06-20 16:00:41 -06:00
Sujal Gupta
2d492834b1
feat: update CMake version to 3.26.4 (#2486)
* update cmake version

* clang-format and clang-tidy fixes for 402c5627

---------

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
2023-06-16 16:08:45 -06:00
ewd00010
5ef7ad5cfe
[feat/docs/fix]: fit check_prime.cpp to guidelines (#2460)
* check_prime_update

docs: added links to file @brief and @details. moved previous @brief to be with function, made comments easier to read in general and added boilerplate documentation to functions.
chore: removed bool result and most brackets in is_prime. Moved assert tests to their own function and added more in, test success now returns message.

* Delete cmake-build-debug directory

* clang-format

* original box_stacking documentation

start point

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Delete box_stacking.cpp

* Update check_prime.cpp

improved files @details text, removed generic t template - replaced with long long

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update check_prime.cpp

removed cin/cout interaction

* Update check_prime.cpp

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update math/check_prime.cpp

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

* Update check_prime.cpp

* Update math/check_prime.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>
2023-06-16 15:27:53 -06:00
ewd00010
5704841875
[feat/docs/fix]: fit check_factorial.cpp to guidelines (#2466)
* 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>
2023-06-16 15:25:06 -06:00
Piotr Idzik
33750ec1f8
fix: cover the cases n == 0 and m < n in N_bonacci (#2468)
* 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
2023-05-30 20:48:05 -06:00
realstealthninja
4b740d464c
fix: fit euler's totient to the contribution guidelines (#2447)
* 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>
2023-04-28 13:56:52 -06:00
Stressed
a0227012ec
feat: add Quadratic equations complex numbers (#2451)
* Added quadratic_equations_complex_numbers.cpp

* Added a demonstration

* Added test cases

* Added test cases

* Revert "Added test cases"

This reverts commit a1433a9318.

* Added test cases and made docs /// instead of //

* test: Added test cases for quadraticEquation
docs: Changed comment style

* test: more test cases
docs: added documentation

* docs: Updated description

* chore: removed redundant returns

* chore: fixed formatting to pass Code Formatter checks

* chore: apply suggestions from code review

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

* test: Added exception test

* Update math/quadratic_equations_complex_numbers.cpp

Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>

* Update math/quadratic_equations_complex_numbers.cpp

Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>

* Update math/quadratic_equations_complex_numbers.cpp

Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>

---------

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>
2023-04-28 13:53:19 -06:00
futoid
fddbf08f5a
feat: added log code for counting digits (#2234)
* 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>
2023-04-14 12:40:14 -06:00
David Leal
1d2c5d9d97
feat: add Sieve of Eratosthenes (originally by @thechubbypanda) (#2442)
* feat: add Sieve of Eratosthenes

Originally created by @thechubbypanda.

* updating DIRECTORY.md

---------

Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
Co-authored-by: Keval Kapdee <keval@thechubbypanda.net>
2023-03-29 14:24:13 -06:00
Defective Detective
249ba8877d
feat: Add aliquot sum of a number algorithm, class Math (#2400)
* 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>
2023-01-22 14:42:58 -06:00
Carlos Rafael
274cab6914
feat: add modular_inverse_simple (#1937)
* 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>
2022-06-09 10:27:12 -05:00
Carlos Rafael
0f5b36d437
fix: power_of_two algorithm redundant conditional 'else' (#1936) 2022-02-10 10:51:06 -06:00
Rijul.S
27ced495bf
test: Add self-test cases in the math/power_of_two.cpp file (#1640)
* Added self implement cases power_of_two.cpp

added assert & a clean code.

* added self implementation cases

* added desciption

* update

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
2022-02-10 08:00:00 -06:00
Mohammad Islam
c1a9019d2a
feat: add perimeter.cpp (#1897)
* Create velocity.cpp

* changed of source file

* changed on perimeter.cpp

* Created perimeter.cpp

* Final

* Testing

* Delete perimeter

* Deleted perimeter

* created perimeter.cpp

* Update perimeter.cpp

* Update math/perimeter.cpp

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

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 5389d9f0

* Update math/perimeter.cpp

Co-authored-by: Ayaan Khan <ayaankhan98@gmail.com>

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David <Panquesito7@users.noreply.github.com>
Co-authored-by: Ayaan Khan <ayaankhan98@gmail.com>
2022-02-02 11:02:02 +05:30
AL-SAHMI
9a58357372
feat: add approximate_pi.cpp file/algorithm (#1860)
* Add approximate_pi.cpp file

* Update math/approximate_pi.cpp

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

* Update math/approximate_pi.cpp

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

* Update math/approximate_pi.cpp

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

* Update math/approximate_pi.cpp

* Update math/approximate_pi.cpp

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

* Update math/approximate_pi.cpp

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

* Update math/approximate_pi.cpp

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

* Update approximate_pi.cpp

* Update math/approximate_pi.cpp

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

* Apply suggestions from code review

Co-authored-by: David Leal <halfpacho@gmail.com>
2022-01-19 09:29:50 -06:00
Allen Guan
1f6c39bcf2
fix: rewrite prime numbers using linear sieve (#1810)
* 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>
2021-10-31 17:47:16 -06:00
Focus
050c99eb0a
feat: added math/volume.cpp (#1796)
* feat: added math/volume.cpp

* updating DIRECTORY.md

* fix: style guide

* fix: pi define to constexpr

* fix: changed PI definition to function param

* fix: style guide

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

* fix: style guide

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

* fix: added functions to math namespace

* [fix/docs]: initialized test variables and added docs

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: Ayaan Khan <ayaankhan98@gmail.com>
2021-10-26 13:19:58 +05:30
Lajat5
b3a0070a74
feat: Reworked/updated sorting/selection_sort.cpp. (#1613)
* Reworked selection_sort.cpp with fixes.

* Added Recursive implementation for tree traversing

* Fix #2

* Delete recursive_tree_traversals.cpp

* Update selection_sort.cpp

* Changes done in selection_sort_iterative.cpp

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 4681e4f7

* Update sorting/selection_sort_iterative.cpp

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

* Update sorting/selection_sort_iterative.cpp

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

* Update selection_sort_iterative.cpp

* Update sorting/selection_sort_iterative.cpp

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

* Update sorting/selection_sort_iterative.cpp

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

* clang-format and clang-tidy fixes for ca2a7c64

* Finished changes requested by ayaankhan98.

* Reworked on changes.

* clang-format and clang-tidy fixes for f79b79b7

* Corrected errors.

* Fix #2

* Fix #3

* Major Fix #3

* clang-format and clang-tidy fixes for 79341db8

* clang-format and clang-tidy fixes for 9bdf2ce4

* Update selection_sort_iterative.cpp

* clang-format and clang-tidy fixes for 9833d7a7

* clang-format and clang-tidy fixes for b7726460

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
2021-10-25 13:17:33 -05:00
Focus
f3b59d173b
feat: added math/area.cpp (#1771)
* 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>
2021-10-24 13:22:40 -05:00
Alvin Philips
51e1dda02e
fix: Union of two arrays (#1794)
* 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>
2021-10-23 19:48:26 -05:00
OM GUPTA
6c6747174c
feat: updated the Prime number checking code to make it more efficient (#1714)
* 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>
2021-10-22 17:07:33 +05:30
Domenic Zingsheim
27f1ed312f
feat: Add integral approximation using Monte Carlo Integration (#1742)
* 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>
2021-10-15 20:34:15 -05:00
ERR !
341ed50da8
feat: Finding no. of digits in a Number (#1497)
* 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>
2021-09-03 14:49:37 -05:00
Bensuperpc
f7d656cb17
feat: Add inverse inverse root functions (#1570)
* Add inverse inverse root function

Add inverse inverse root function

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>

* Update comment

Update comment

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>

* Update math/inv_sqrt.cpp

Change to IO operations

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

* Update math/inv_sqrt.cpp

Update comment

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

* Update math/inv_sqrt.cpp

Update comment

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

* Update math/inv_sqrt.cpp

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

* Update math/inv_sqrt.cpp

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

* Fix fist warning

Fix fist warning

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>

* Fix warning N2

Fix warning N2

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>

* Fix warning N3

Fix warning N3

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>

* Fix warning N4

Fix warning N4

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>

* updating DIRECTORY.md

* Update math/inv_sqrt.cpp

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

* Update math/inv_sqrt.cpp

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

* Update math/inv_sqrt.cpp

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

* clang-format and clang-tidy fixes for 1acc7773

* Update math/inv_sqrt.cpp

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

* Update math/inv_sqrt.cpp

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

* Add tests and improve comment

Add tests and improve comment

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>

* Update math/inv_sqrt.cpp

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

* Add default template type (double)

Add default template type (double)

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>

* Update comment

Update comment

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>

* Update math/inv_sqrt.cpp

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

* Add comments

Add comments

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>

* updating DIRECTORY.md

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-09-01 11:20:01 -05:00
Swastika Gupta
a764d57e96
feat: Add n_bonacci.cpp in math section (#1544)
* n-bonacci

* Update math/n_bonacci.cpp

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

* Update math/n_bonacci.cpp

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

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for f30cb377

* Update math/n_bonacci.cpp

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

* clang-format and clang-tidy fixes for 4af9dc38

* Update n_bonacci.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
2021-07-29 12:29:27 -05:00
Swastika Gupta
bd44418731
feat: Add count_of_trailing_ciphers_in_factorial_n (#1543)
* zeroes

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

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

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

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

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

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

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

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

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

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

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 537cd7e8

* Update count_of_trailing_ciphers_in_factorial_n.cpp

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

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

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

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

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

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

* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp

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

* clang-format and clang-tidy fixes for a8c85e2d

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Abhinn Mishra <49574460+mishraabhinn@users.noreply.github.com>
2021-07-29 11:41:52 -05:00
codingbbq
f9a1acd4c3
Issue #1536 - [BUG] check_prime.cpp returns incorrect output for 9 (#1537)
Co-authored-by: Idrish Laxmidhar <idrish.l@hcl.com>
Co-authored-by: Vishal Sharma <mrvishalsharma@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2021-07-22 13:08:28 -05:00
Benjamin Walton
a41b707919
feat: added integral approximation algorithm (#1485)
* Setup general integral aprroximation algorithm template

* feat: added integral approximation algorithm

* updating DIRECTORY.md

* feat: added integral approximation algorithm

* test: added tests for integral approximation algorithm

* docs: added comments and explanation for integral approximation algorithm

* fix: updated for loop within algorithm

* fix: data type conversions

* Modified dividing by 2

Maintains functionality but dividing by 2 is easier to read/understand

* Update math/integral_approximation.cpp

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

* Update math/integral_approximation.cpp

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

* Update math/integral_approximation.cpp

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

* Update math/integral_approximation.cpp

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

* Update math/integral_approximation.cpp

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

* fix: Apply suggestions from code review

* fix: Apply suggestions from code review

* fix: Apply suggestions from code review

* fix: Apply suggestions from code review

* fix: Apply suggestions from code review

* fix: Apply suggestions from code review

* fix: Apply suggestions from code review

* fix: Apply suggestions from code review

* fix: Apply suggestions from code review

* fix: Apply suggestions from code review

* fix: Apply suggestions from code review

* feat: added Wikipedia link and detailed description

* fix: Apply suggestions from code review

* Update math/integral_approximation.cpp

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

* Update math/integral_approximation.cpp

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

* Update math/integral_approximation.cpp

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

* style: updated what the library/header is for

* docs: Update math/integral_approximation.cpp

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

* fix: changed int to uint64_t

* Update math/integral_approximation.cpp

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

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Shiqi Sheng <shiqisheng00@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
2021-04-22 22:11:44 +05:30
Ashish Bhanu Daulatabad
73ff948b0d
feat: Solving linear recurrence using Matrix Exponentiation (with examples). (#1463)
* updating DIRECTORY.md

* feat: Solving Linear Recurrence using Matrix Exponentiation

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 83efb534

* Directory.md

* updating DIRECTORY.md

* Comment Modification

* Comments

* Missing namespace

* Missing namespace

* Type checking

* reduced mod size due to integer overflow, changed int32 to int64

* Adding template parameters and missing markdowns.

* Markdown and minor code changes

* Minor changes

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-03-17 23:57:51 +05:30
Max A. Jurankov
0b890fd842
feat: add program to calculate binomial coefficients (#1448)
* Add program to calculate binomial coefficients

* docs: add link to github profile, change cmath to cstdlib

* correction of comments, adding math namespace

* updating DIRECTORY.md

* Adding binomial namespace, rename function and filename, correcting comments

* updating DIRECTORY.md

Co-authored-by: astronmax <astronmax@yandex.ru>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-02-23 00:51:58 +05:30
Neha Hasija
9438ea11a2
Create power_of_two.cpp (#1315)
* Create power_of_two.cpp

This Pull Request is for HacktoberFest 2020

* Update math/power_of_two.cpp

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

* Update math/power_of_two.cpp

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

* Update math/power_of_two.cpp

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

* Update math/power_of_two.cpp

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

* Update math/power_of_two.cpp

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

* Update math/power_of_two.cpp

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

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 3d017c44

* Update math/power_of_two.cpp

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

* Update math/power_of_two.cpp

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

* Update math/power_of_two.cpp

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

* clang-format and clang-tidy fixes for f76c1009

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-02-12 10:14:01 +05:30
Shreyas Sable
f4423503a1
cross product of two vectors (#1292)
* cross product of two vectors

* cross product of two mathematical vectors (fixed)

* cross product of two mathematical vectors (fixed)

* updating DIRECTORY.md

* cross product of two mathematical vectors (fixed)

* cross product of two mathematical vectors (fixed)

* cross product of two mathematical vectors (fixed)

* cross product of two vectors (with tests)

* cross product of two mathematical vectors (fixed)

* cross product of two vectors (with example fixed)

* cross product of two vectors

* cross product of two mathematical vectors

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-02-05 15:13:45 +05:30
villayatali123
f222acde97
Nth fibonacci number using matrix exponentiation (#1215)
* Nth fibonacci number using matrix exponentiation
Co-authored-by: unknown <villizain6@gmail.com>
2021-02-05 15:12:13 +05:30
github-actions
a4f830b90b clang-format and clang-tidy fixes for 7293e15a 2021-01-18 10:45:57 +00:00
shubhamamsa
7293e15a30 feat: addressed comments for math/modular_division.cpp 2021-01-18 16:14:35 +05:30
github-actions
b9cdab9354 clang-format and clang-tidy fixes for 2ad5420a 2021-01-17 20:44:59 +00:00
shubhamamsa
2ad5420a7c feat: Addressed comments for adding modular division algorithm 2021-01-18 02:13:32 +05:30
shubhamamsa
0450f6a179 feat: added modular division algorithm 2021-01-17 23:09:01 +05:30
CHILUKA UDAYCHANDRA
de99092144
feat: largest_power (#1406)
* largest_power

* Update math/largest_power.cpp

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

* Update math/largest_power.cpp

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

* Update math/largest_power.cpp

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

* Update math/largest_power.cpp

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

* Update math/largest_power.cpp

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

* Update math/largest_power.cpp

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

* Update math/largest_power.cpp

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

* Update math/largest_power.cpp

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

* Update math/largest_power.cpp

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

* Update math/largest_power.cpp

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

* added a new line

* updating DIRECTORY.md

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-11-25 04:18:50 -05:00
Kaustubh Damania
67e26cfbae
feat: Add ncr mod p code (#1325)
* feat: Add ncr mod p code (#1323)

* Update math/ncr_modulo_p.cpp

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

* Added all functions inside a class + added more asserts

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for f6df24a5

* Replace int64_t to uint64_t + add namespace + detailed documentation

* clang-format and clang-tidy fixes for e09a0579

* Add extra namespace + add const& in function arguments

* clang-format and clang-tidy fixes for 8111f881

* Update ncr_modulo_p.cpp

* clang-format and clang-tidy fixes for 2ad2f721

* Update math/ncr_modulo_p.cpp

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

* Update math/ncr_modulo_p.cpp

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

* Update math/ncr_modulo_p.cpp

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

* clang-format and clang-tidy fixes for 5b69ba5c

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for a8401d4b

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-11-22 23:05:01 +05:30
Taj
a283f2a96f
Feat: added n_choose_r combinatorics algorithm (#1429)
* feat: added n_choose_r combinatorial algorithm

* fix: some type casting issue

* fix: MathJax documentation fix

* fix: MathJax documentation fix

* fix: MathJax notation fix

* fix: header comments

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

* fix: suggested changes to documentation

* updating DIRECTORY.md

* fix: suggested changes

* fix: suggested changes

* fix: namespace closing comment

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

* fix: removing a blank line

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

* fix: link issue

* fix: removed link

* fix: removed newline

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

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-11-17 01:09:52 +05:30
Sarthak Sahu
c9d298fec6
feat: add fibonacci_sum.cpp (#1343)
* Johnson's Algorithm added

* Update Johnson's algorithm.cpp

@Panquesito7 plzz review

* Update Johnson's algorithm.cpp

* remove johnson'algo

* add fibo_sum.cpp

* updating DIRECTORY.md

* Update math/fibonacci_sum.cpp

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

* Update math/fibonacci_sum.cpp

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

* Update math/fibonacci_sum.cpp

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

* Update math/fibonacci_sum.cpp

Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>

* Update math/fibonacci_sum.cpp

Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>

* Update math/fibonacci_sum.cpp

Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>

* Update math/fibonacci_sum.cpp

Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>

* clang-format and clang-tidy fixes for a054b759

Co-authored-by: SarthakSahu1009 <sarthaksashu1009@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: Krishna Vedala <7001608+kvedala@users.noreply.github.com>
2020-10-30 23:23:02 +05:30
Shri Prakash Bajpai
fee3a74e35
feat: Add modular_exponentiation.cpp (#1276)
* Add modular_exponentiation

* Delete modular_exponentiation

* Add modular_exponentiation

* Update and rename modular_exponentiation to modular_exponentiation.cpp

* Update modular_exponentiation.cpp

* Update math/modular_exponentiation.cpp

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

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for 4b93d5a5

* Update modular_exponentiation.cpp

* Update modular_exponentiation.cpp

* Update modular_exponentiation.cpp

* Update modular_exponentiation.cpp

* Update modular_exponentiation.cpp

* Update math/modular_exponentiation.cpp

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

* Update math/modular_exponentiation.cpp

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

* clang-format and clang-tidy fixes for 053aea0b

* Update math/modular_exponentiation.cpp

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

* Update math/modular_exponentiation.cpp

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

* Update math/modular_exponentiation.cpp

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

* Update math/modular_exponentiation.cpp

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

* Update math/modular_exponentiation.cpp

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

* Update modular_exponentiation.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-10-30 01:52:32 +05:30
muskan0719
0f8324ed49
feat: add sum_of_binomial_coefficients (#1363)
* Add files via upload

* update sum_of_binomial_coefficients

* Update math/sum_of_binomial_coefficient.cpp

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

* Update math/sum_of_binomial_coefficient.cpp

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

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for e7ac2255

* Update math/sum_of_binomial_coefficient.cpp

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

* Update sum_of_binomial_coefficient.cpp

* Update math/sum_of_binomial_coefficient.cpp

Co-authored-by: Ayaan Khan <ayaankhan98@gmail.com>

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Ayaan Khan <ayaankhan98@gmail.com>
2020-10-28 14:23:57 +05:30
Ayaan Khan
2e277c354d
Merge pull request #1318 from neha-hasija17/patch-3
feat: Create magic_number.cpp
2020-10-27 23:12:23 +05:30
Neha Hasija
806f3251ee
Update math/magic_number.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
2020-10-27 06:33:29 +05:30
Neha Hasija
69cacbc88b
Update math/magic_number.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
2020-10-27 06:33:14 +05:30
chestamittal
2d415763d7
Update math/lcm_sum.cpp
Co-authored-by: Ayaan Khan <ayaankhan98@gmail.com>
2020-10-27 01:09:08 +05:30
chestamittal
57729bf37f
Update math/lcm_sum.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
2020-10-26 00:00:43 +05:30