realstealthninja
c6af943508
fix: add cstdint header to all files using fixed width integers ( #2717 )
...
* fix: add <cstdint> to subset_sum.cpp
* fix: add <cstdint> to subarray_sum.cpp
* fix: add <cstdint> to wildcard_matching.cpp
* fix: add <cstdint> to count_bit_flips.cpp
* fix: add <cstdint> to count_of_set_bits.cpp
* fix: add <cstdint> to trailing_ciphers.cpp
* fix: add <cstdint> to hamming_distance.cpp
* doc: include doc for hamming_distance
* fix: add <cstdint> to next_higher_numebr_with_same_number_of_set_bits.cpp
* fix: add <cstdint> to power_of_2.cpp
* fix: add <cstdint> to set_kth_bit.cpp
* fix: add <cstdint> to bit_manipulation/set_kth_bit.cpp
* fix: add <cstdint> to bit_manipulation/travelling_salesman_using_bit_manipulation.cpp
* fix: add <cstdint> to ciphers/base64_encoding.cpp
* fix: add <cstdint> to ciphers/hill_cipher.cpp
* fix: add <cstdint> to ciphers/uint128_t.hpp
* fix: add <cstdint> to data_structures/dsu_path_compression.cpp
* fix: add <cstdint> to data_structures/dsu_path_compression.cpp
* fix add <cstdint> to datastructures/list_array>cpp
* fix add <cstdint> to datastructures/queue_using_array.cpp
* fix: add <cstdint> to sparse_table.cpp
* fix: add <cstdint> to stack_using_list_queue.cpp
* fix: add <cstdint> to treap.cpp
* fix: add <cstdint> to graham_scan_functions.hpp
* fix: add <cstdint> to graph/**
* fix: add integral typdefs to hashing/**
* fix: add <cstdint> to math/**
* fix: add <cstdint> to numerical_methods/**
* fix: add <cstdint> to other/**
* fix: add <cstdint> to search/**
* fix: add <cstdint> to sorting/**
* fix: add <cstdint> to string/**
* doc: remove include statement from comment
* fix: make tests static
Co-authored-by: David Leal <halfpacho@gmail.com >
* fix: make tests static
Co-authored-by: David Leal <halfpacho@gmail.com >
* chore: use iwyu on backtracking/**.cpp
* chore: use iwyu on bit_manip/**.cpp
* chore: use iwyu on ciphers/**.cpp
* chore: use iwyu on cpu_scheduling_algorithms/**.cpp
* chore: use iwyu on data_structures/**.cpp
* chore: use iwyu on divide_and_conquer/**.cpp
* chore: use iwyu on geometry/**.cpp
* chore: use iwyu on graph/**.cpp
* chore: use iwyu on hashing/**.cpp
* chore: use iwyu on machine_learning/**.cpp
* chore: use iwyu on math/**.cpp
* chore: use iwyu on numerical_methods/**.cpp
* chore: use iwyu on others/**.cpp
* chore: use iwyu on probablity/**.cpp
* chore: use iwyu on search/**.cpp
* chore: use iwyu on sorting/**.cpp
* chore: use iwyu on strings/**.cpp
* Revert "chore: use iwyu on strings/**.cpp"
This reverts commit f2127456a8 .
* Revert "chore: use iwyu on sorting/**.cpp"
This reverts commit a290ae7ee2 .
* Revert "chore: use iwyu on search/**.cpp"
This reverts commit 19d136ae0f .
* Revert "chore: use iwyu on probablity/**.cpp"
This reverts commit 5dd7f82a34 .
* Revert "chore: use iwyu on others/**.cpp"
This reverts commit 8a8fd42383 .
* Revert "chore: use iwyu on numerical_methods/**.cpp"
This reverts commit eff2f44a50 .
* Revert "chore: use iwyu on math/**.cpp"
This reverts commit c47117ca3f .
* Revert "chore: use iwyu on machine_learning/**.cpp"
This reverts commit c3897d3763 .
* Revert "chore: use iwyu on hashing/**.cpp"
This reverts commit 0c6611a835 .
* Revert "chore: use iwyu on graph/**.cpp"
This reverts commit dabd6d2591 .
* Revert "chore: use iwyu on geometry/**.cpp"
This reverts commit 740bd65932 .
* Revert "chore: use iwyu on divide_and_conquer/**.cpp"
This reverts commit 16ee49e086 .
* Revert "chore: use iwyu on data_structures/**.cpp"
This reverts commit a3b719e368 .
* Revert "chore: use iwyu on cpu_scheduling_algorithms/**.cpp"
This reverts commit 24e597f7e2 .
* Revert "chore: use iwyu on ciphers/**.cpp"
This reverts commit 3d80295883 .
* Revert "chore: use iwyu on bit_manip/**.cpp"
This reverts commit 7edcb6e458 .
* Revert "chore: use iwyu on backtracking/**.cpp"
This reverts commit f0a30d7cdb .
* Update search/binary_search.cpp
* Update backtracking/subarray_sum.cpp
* Update backtracking/subset_sum.cpp
* Update backtracking/wildcard_matching.cpp
* Update bit_manipulation/count_bits_flip.cpp
* Update bit_manipulation/count_of_set_bits.cpp
* Update bit_manipulation/count_of_trailing_ciphers_in_factorial_n.cpp
* Update bit_manipulation/hamming_distance.cpp
* Update bit_manipulation/next_higher_number_with_same_number_of_set_bits.cpp
* Update bit_manipulation/power_of_2.cpp
* Update others/lru_cache.cpp
* Update bit_manipulation/set_kth_bit.cpp
* Update bit_manipulation/travelling_salesman_using_bit_manipulation.cpp
* Update ciphers/base64_encoding.cpp
* Update ciphers/hill_cipher.cpp
* Update ciphers/uint128_t.hpp
* Update cpu_scheduling_algorithms/fcfs_scheduling.cpp
* Update data_structures/dsu_path_compression.cpp
* Update data_structures/dsu_union_rank.cpp
* Update data_structures/list_array.cpp
* Update data_structures/queue_using_array.cpp
* Update data_structures/sparse_table.cpp
* Update data_structures/stack_using_queue.cpp
* Update data_structures/treap.cpp
* Update geometry/graham_scan_functions.hpp
* Update graph/bidirectional_dijkstra.cpp
* Update graph/connected_components_with_dsu.cpp
* Update graph/cycle_check_directed_graph.cpp
* Update graph/is_graph_bipartite2.cpp
* Update graph/travelling_salesman_problem.cpp
* Update hashing/md5.cpp
* Update hashing/sha1.cpp
* Update math/n_choose_r.cpp
* Update strings/z_function.cpp
* Update strings/manacher_algorithm.cpp
* Update sorting/wiggle_sort.cpp
* Update sorting/selection_sort_recursive.cpp
* Update sorting/selection_sort_iterative.cpp
* Update sorting/recursive_bubble_sort.cpp
* Update sorting/radix_sort2.cpp
* Update sorting/dnf_sort.cpp
* Update sorting/cycle_sort.cpp
* Update search/sublist_search.cpp
* Update search/saddleback_search.cpp
* Update search/interpolation_search.cpp
* Update search/floyd_cycle_detection_algo.cpp
* Update search/exponential_search.cpp
* Update search/exponential_search.cpp
* Update math/n_bonacci.cpp
* Update math/aliquot_sum.cpp
* Update math/check_factorial.cpp
* Update math/double_factorial.cpp
* Update math/eulers_totient_function.cpp
* Update math/factorial.cpp
* Update math/fibonacci.cpp
* Update math/fibonacci_matrix_exponentiation.cpp
* Update math/fibonacci_sum.cpp
* Update math/finding_number_of_digits_in_a_number.cpp
* chore: remove "/// for integral typedefs"
* chore: remove for integral typedefs from modular division
* fix: remove comment from include
* fix: add cstdint to gale shapely
---------
Co-authored-by: David Leal <halfpacho@gmail.com >
2024-11-04 17:38:54 +05:30
Ritobroto Kalita
649a145234
docs, test: Fit Sieve of Eratosthenes to contributing guidelines ( #2803 )
...
* Update sieve_of_eratosthenes.cpp
* Update doc
---------
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com >
2024-10-29 22:38:49 +05:30
Nguyen Phuc Chuong
37a9811372
docs, test: fit modular inverse fermat little theorem to contributing guidelines ( #2779 )
...
* Update modular_inverse_fermat_little_theorem.cpp
* Update modular_inverse_fermat_little_theorem.cpp
* Update modular_inverse_fermat_little_theorem.cpp
* Update modular_inverse_fermat_little_theorem.cpp
* Update math/modular_inverse_fermat_little_theorem.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com >
* Update math/modular_inverse_fermat_little_theorem.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com >
* Update modular_inverse_fermat_little_theorem.cpp
Add time complexity in comment
* Update modular_inverse_fermat_little_theorem.cpp
* Update modular_inverse_fermat_little_theorem.cpp
---------
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com >
2024-10-21 18:51:23 +05:30
Ritobroto Kalita
512efd1861
fix: Update documentations and tests for fibonacci.cpp ( #2793 )
...
* Update fibonacci.cpp
* update documentation
* Update documentation
2024-10-09 18:45:12 +05:30
Nguyen Phuc Chuong
fddedd8864
fix: Adding documentations, tests, and amending algorithm for gcd_of_n_numbers.cpp ( #2766 )
...
* Update gcd_of_n_numbers.cpp
* Update gcd_of_n_numbers.cpp
Reformatting code, comment and test cases, change array data type.
* Update gcd_of_n_numbers.cpp
* Update gcd_of_n_numbers.cpp
* Update gcd_of_n_numbers.cpp
* Update gcd_of_n_numbers.cpp
2024-10-07 18:56:25 +05:30
Harshil Shah
b957b1dfef
feat: Add hemi-sphere area algorithm ( #2767 )
...
* Add area of hemi-sphere
* Update math/area.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com >
---------
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com >
2024-10-07 06:15:29 +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
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
Stressed
17a532637a
feat: add Iterative Factorial ( #2453 )
...
* Feat: Iterative factorial
* Test: Added tests for iterative factorial
* Fix: Added throw when argument exceeds maximum
Docs: Updated docs to to explain why maximum is 20
* Feat: iterative_factorial
docs: Added documentation to some functions.
test: Added exception test.
* chore: Fixed formatting
* docs: Added documentation, changed examples.
* Update math/iterative_factorial.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com >
* Update math/iterative_factorial.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com >
* Update math/iterative_factorial.cpp
Co-authored-by: David Leal <halfpacho@gmail.com >
* Update math/iterative_factorial.cpp
Co-authored-by: David Leal <halfpacho@gmail.com >
* chore: apply suggestions from code review
* Update math/iterative_factorial.cpp
Co-authored-by: David Leal <halfpacho@gmail.com >
* Update math/iterative_factorial.cpp
Co-authored-by: Taj <tjgurwara99@users.noreply.github.com >
* Fix: Exception test termination bug
* Update math/iterative_factorial.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com >
* Update math/iterative_factorial.cpp
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com >
---------
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com >
Co-authored-by: David Leal <halfpacho@gmail.com >
Co-authored-by: Taj <tjgurwara99@users.noreply.github.com >
2023-07-20 22:45:57 -06:00
ewd00010
aaf84ab08f
fix: fit approximate_pi.cpp to guidelines ( #2499 )
...
* Update approximate_pi.cpp
* clang-format and clang-tidy fixes for 5a951bdf
---------
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com >
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com >
Co-authored-by: David Leal <halfpacho@gmail.com >
2023-07-19 14:53:16 -06:00
realstealthninja
37aae7ced4
docs: fit factorial.cpp to contribution guidelines ( #2487 )
...
* doc: fit factorial.cpp to contribution guidelines
* Update math/factorial.cpp
Co-authored-by: David Leal <halfpacho@gmail.com >
* chore: remove redundant include
* docs: add documentation for parameter `n`
* clang-format and clang-tidy fixes for ec43ea0f
---------
Co-authored-by: David Leal <halfpacho@gmail.com >
Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com >
2023-07-18 22:53:15 -06:00
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