Skip to content

efficient solution for GCD question#1035

Closed
aka-0803 wants to merge 1 commit intoTheAlgorithms:masterfrom
aka-0803:master
Closed

efficient solution for GCD question#1035
aka-0803 wants to merge 1 commit intoTheAlgorithms:masterfrom
aka-0803:master

Conversation

@aka-0803
Copy link
Copy Markdown

->used Euclidean algorithm
->Time Complexity: O(min(a,b))
->Auxiliary Space: O(min(a,b))
-> more about Euclidean algorithm
->clean code

Description of Change

References

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:

->used Euclidean algorithm
->Time Complexity: O(min(a,b))
->Auxiliary Space: O(min(a,b))
-> more about Euclidean algorithm
->clean code
Copy link
Copy Markdown
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For more information, check our contributing guidelines carefully.
If you need any help, let us know here or on our Discord server! 🙂

Comment thread misc/gcd.cpp
Comment on lines +16 to +17
#include <bits/stdc++.h>
using namespace std;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are discouraged. Please use each header/library you need and strictly use std::.

Comment thread misc/gcd.cpp
#include <bits/stdc++.h>
using namespace std;

int gcd(int a, int b)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functions should be documented explaining the use of its parameters, a brief description, and what it returns.

Comment thread misc/gcd.cpp
@@ -0,0 +1,44 @@
/**
* @file gcd.cpp
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add the filename. It's best to let Doxygen automatically detect it, otherwise, you'd have to specify the whole directory as well.

Suggested change
* @file gcd.cpp
* @file

Comment thread misc/gcd.cpp
* Time Complexity: O(min(a,b))
* Auxiliary Space: O(min(a,b))
* @author Akash (https://github.com/aka-0803)
* @copyright Copyright (c) 2022
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unneeded.

Suggested change
* @copyright Copyright (c) 2022

Comment thread misc/gcd.cpp
* @details
* Time Complexity: O(min(a,b))
* Auxiliary Space: O(min(a,b))
* @author Akash (https://github.com/aka-0803)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always use Markdown when specifying the author's name and GitHub link.

Suggested change
* @author Akash (https://github.com/aka-0803)
* @author [Akash](https://github.com/aka-0803)

Comment thread misc/gcd.cpp
* @brief
* The idea is, GCD of two numbers doesn’t change if smaller number is subtracted from a bigger number.
* More about Euclidean algorithm-> https://www.geeksforgeeks.org/euclidean-algorithms-basic-and-extended/
* @details
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add more details about the algorithm itself, how it works, etc.. You can take a bit of information from other sources as long as it's not plagiarism.

@Panquesito7 Panquesito7 added enhancement New feature or request Autochecks are failing Failing CI Auto-checks Changes requested Proper Documentation Required requested to write the documentation properly labels Oct 27, 2022
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the Stale label Dec 20, 2022
@github-actions
Copy link
Copy Markdown
Contributor

Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

@github-actions github-actions Bot closed this Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Autochecks are failing Failing CI Auto-checks Changes requested enhancement New feature or request Proper Documentation Required requested to write the documentation properly Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants