C-Plus-Plus icon indicating copy to clipboard operation
C-Plus-Plus copied to clipboard

[FIX] Pre-existing algorithms do not fit the contribution guidelines

Open realstealthninja opened this issue 2 years ago • 13 comments

Detailed description

Times change

so does the development of algorithms and documentation

Some of the older algorithms existing in this repository do not fit the contribution guidelines.

A short list of examples:

Context

Educating new developers on coding standards is a major priority; As the industry today relies heavily on documentation; If you were to ask any API developer/user on what the most important part of their development and use it will always be:

  • Code quality
  • documentation

having a fast and performant algorithm is good but whats the point if you cant understand how it works or even why it works.

I think it is in the best interest of us to document our algorithms.

As i consider all algorithms must be:

  • beautiful
  • understandable
  • educational

Possible implementation

No response

Additional information

Others in the past have made major changes like this to this repository and i think its time for us to do the same. to keep the torch moving.

An homage to @kvedala for their part in trying to standardize this repository #805

realstealthninja avatar Apr 30 '23 07:04 realstealthninja

Hi, I wanted to start contributing to this repository ,can you assign me this problem

Kunal766 avatar May 29 '23 12:05 Kunal766

No sorry no assigning in this repository just start making a pull request and we will review to help you.❤️

Note: assigning requires triage access

realstealthninja avatar May 30 '23 02:05 realstealthninja

how can help so that this issue will be resolved

CodeSinghh avatar Jun 19 '23 15:06 CodeSinghh

how can help so that this issue will be resolved

just find an algorithm that does not fit the contribution guidelines and start fixing it! we will close this issue once ALL the algorithms are fixed! :smile:

realstealthninja avatar Jun 20 '23 05:06 realstealthninja

Math Directory Checklist

Below is the list of algorithms to be checked within the maths repository. Footnotes provide details to potential changes This is a guide. Please fully check any file you work on! You may find other changes are needed.

  • [X] aliquot_sum.cpp
  • [X] approximate_pi.cpp [^1] [^4]
  • [ ] area.cpp [^2] [^3][^4][^5] [IN PROGRESS]
  • [X] armstrong_number.cpp
  • [X] binary_exponent.cpp
  • [X] binomial_calculate.cpp
  • [X] check_amicable_pair.cpp
  • [X] check_factorial.cpp
  • [X] check_prime.cpp
  • [ ] complex_numbers.cpp [^2] [^3][^4]
  • [ ] double_factorial.cpp [^2] [^3][^4]
  • [ ] eratosthenes.cpp [^1] [^5] [IN PROGRESS] looks ok, has code in main
  • [ ] eulers_totient_function.cpp [^1] [^4] [IN PROGRESS]
  • [ ] extended_euclid_algorithm.cpp [^2] [^3][^4][^5]
  • [x] factorial.cpp [^2] [^3][^4][^5]
  • [ ] fast_power.cpp [^2] [^3][^4][^5]
  • [ ] fibonacci.cpp [^1] [^3][^4][^5]
  • [ ] fibonacci_fast.cpp [^2] [^3][^4][^5]
  • [ ] fibonacci_large.cpp [^2] [^3][^4][^5]
  • [ ] fibonacci_matrix_exponentiation.cpp [^2] [^3][^4][^5] more white space then you could fit in a 747
  • [ ] fibonacci_sum.cpp [^1] [^3][^4]
  • [ ] finding_number_of_digits_in_a_number.cpp [^1] [^3][^4]
  • [ ] gcd_iterative_euclidean.cpp [^2] [^3][^4][^5]
  • [ ] gcd_of_n_numbers.cpp [^2] [^3][^4][^5]
  • [ ] gcd_recursive_euclidean.cpp [^2] [^3][^4][^5]
  • [ ] integral_approximation.cpp [^2] [^3][^4][^5] change name to integral_approximation_Reimann.cpp ?
  • [ ] integral_approximation2.cpp [^2] [^3][^4][^5] change name to integral_approximation_Monte_Carlo.cpp ?
  • [ ] inv_sqrt.cpp [^1] [^3][^4][^5]
  • [ ] large_factorial.cpp [^2] [^3][^4][^5]
  • [ ] large_number.h [^2] [^3][^4] this is quite a big bit of code to check, [^5] may apply here
  • [ ] largest_power.cpp [^1] [^3][^4][^5]
  • [ ] lcm_sum.cpp [^1] [^3][^4] is there a more efficient version of this?
  • [ ] least_common_multiple.cpp [^1] [^3][^4][^5]
  • [ ] linear_recurrence_matrix.cpp [^1] [^3][^4][^5]
  • [ ] magic_number.cpp [^1] [^3][^4][^5]
  • [ ] miller_rabin.cpp [^1] [^3][^4][^5]
  • [ ] modular_division.cpp [^1] [^3][^4][^5]
  • [ ] modular_exponentiation.cpp [^1] [^3][^4]
  • [ ] modular_inverse_fermat_little_theorem.cpp [^2] [^3][^4][^5]
  • [ ] modular_inverse_simple.cpp [^1] [^3][^4][^5]
  • [ ] n_bonacci.cpp[^1] [^3][^4] small comment restructure, potentially needs formatted
  • [ ] n_choose_r.cpp [^2] [^3][^4][^5] uses template, states only for uint64_t. test cases are strange?
  • [ ] ncr_modulo_p.cpp [^2] [^3][^4][^5]
  • [ ] number_of_positive_divisors.cpp [^2] [^4][^5]
  • [ ] perimeter.cpp [^1] [^3][^5]
  • [ ] power_for_huge_numbers.cpp [^2] [^3][^4][^5]
  • [ ] power_of_two.cpp [^1] [^3][^4][^5] this one has commented out user input test, maintainer should decide if it stays in
  • [ ] prime_factorization.cpp [^2] [^3][^4][^5]
  • [ ] prime_numbers.cpp [^2] [^3][^4][^5]
  • [ ] primes_up_to_billion.cpp [^2] [^3][^4][^5]
  • [ ] quadratic_equations_complex_numbers.cpp [^1] [^3][^4][^5]
  • [ ] realtime_stats.cpp [^2] [^3][^4][^5]
  • [ ] sieve_of_eratosthenes.cpp [^2] [^3][^4][^5]
  • [ ] sqrt_double.cpp [^2] [^3][^4][^5]
  • [ ] string_fibonacci.cpp [^2] [^3][^4][^5] I don't understand why the ifdef is necessary
  • [ ] sum_of_binomial_coefficient.cpp [^1] [^3][^4]
  • [ ] sum_of_digits.cpp [^2] [^3][^4][^5]
  • [ ] vector_cross_product.cpp [^1] [^3][^4][^5]
  • [ ] volume.cpp [^2] [^3][^4][^5]

[^1]: This algorithm needs a small amount of changes [^2]: This algorithm needs a large amount of changes [^3]: Test rework [^4]: Doc rework [^5]: Code rework

ewd00010 avatar Jul 01 '23 17:07 ewd00010

In terms of making these changes/fixes to the style to fit the guidelines. How do you want PRs to work? My thinking was just 1 small PR based on changes to one module to minimize the changes which need reviewed.

rbevin777 avatar Jul 21 '23 12:07 rbevin777

In terms of making these changes/fixes to the style to fit the guidelines. How do you want PRs to work? My thinking was just 1 small PR based on changes to one module to minimize the changes which need reviewed.

one pr for one file

realstealthninja avatar Jul 21 '23 13:07 realstealthninja

I'm starting to look at the area.cpp file here just so no one picks it up by accident 😁

rbevin777 avatar Jul 21 '23 18:07 rbevin777

Please assign me fast_power.cpp

Bl1xvan avatar Aug 30 '23 11:08 Bl1xvan

Submitted a PR for sum_of_digits.cpp It's my first PR so let me know if adjustments are needed. I did forget my .vscode json was in there, I'll remember to exclude it from my commit next time!

dylancusson avatar Sep 26 '23 05:09 dylancusson