Skip to content

docs/refactor: clean check_prime.cpp variable names and guidelines - #3207

Open
yasmeenMohammed wants to merge 1 commit into
TheAlgorithms:masterfrom
yasmeenMohammed:fix/cleanup-check-prime
Open

docs/refactor: clean check_prime.cpp variable names and guidelines#3207
yasmeenMohammed wants to merge 1 commit into
TheAlgorithms:masterfrom
yasmeenMohammed:fix/cleanup-check-prime

Conversation

@yasmeenMohammed

Copy link
Copy Markdown

Refactored check_prime.cpp to fully align with the repository's modern contribution guidelines.

Key Enhancements:

  • Variable Renaming: Eliminated short/single-letter variables (num, i) and replaced them with descriptive alternatives (number, factor) for clear code quality.
  • Documentation Fix: Corrected an accuracy error in the file comments regarding prime number distribution (corrected even primes distribution description to odd primes).
  • Complexity Tracking: Injected explicit Doxygen annotations detailing the Time Complexity of $O(\sqrt{N})$ and Space Complexity of $O(1)$.
  • Assertion Scaling: Enhanced the local testing framework by introducing missing boundary conditions like checking for 0.

Closes part of #2456

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant