Skip to content

Another method added for GCD #1387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Oct 22, 2019
Merged

Another method added for GCD #1387

merged 12 commits into from
Oct 22, 2019

Conversation

subahanii
Copy link
Contributor

No description provided.


# This method is more efficient not acquire more memory cause is no use of any stacks like in recursive as next below mentioned.
def gcd_by_iterative(x,y):
while y:x,y=y,x%y
Copy link
Member

Choose a reason for hiding this comment

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

Please split this over two lines for readability.
Please add doctests to both functions. See CONTRIBUTING.md for details.

Copy link
Contributor Author

@subahanii subahanii left a comment

Choose a reason for hiding this comment

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

Now doctest fullfiled for previous added method for GCD.

except (IndexError, UnboundLocalError, ValueError):
print("Wrong Input")


Copy link
Member

Choose a reason for hiding this comment

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

Please lose this whitespace.

@cclauss
Copy link
Member

cclauss commented Oct 19, 2019

@cclauss cclauss added the tests are failing Do not merge until tests pass label Oct 20, 2019
@cclauss
Copy link
Member

cclauss commented Oct 20, 2019

@subahanii
Copy link
Contributor Author

https://travis-ci.com/TheAlgorithms/Python/builds/132626798#L384

Also see https://docs.python.org/3/library/doctest.html

I am not getting where is problem. Please Marge this all is right.

@subahanii
Copy link
Contributor Author

https://travis-ci.com/TheAlgorithms/Python/builds/132626798#L384

Also see https://docs.python.org/3/library/doctest.html

Why you have marked as "Automated test is failing".

@cclauss cclauss removed the tests are failing Do not merge until tests pass label Oct 22, 2019
@cclauss cclauss merged commit 7444a1f into TheAlgorithms:master Oct 22, 2019
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* Another method added for GCD

* Now doctest fulfilled for added method.

* Update greatest_common_divisor.py

* Now unnecessary white spaces removed.

* Cycle_Detection_Undirected_Graph

Cycle_Detection_Undirected_Graph using Disjoint set DataStructure

* Update greatest_common_divisor.py again

* Again Updated cycle_detection_undirected_graph.py

* Delete cycle_detection_undirected_graph.py

* Add doctests and format the code with psf/black

* fixup: Typo

* Update greatest_common_divisor.py

* greatest_common_divisor()
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.

2 participants