Optimized recursive_bubble_sort (#2410)

* optimized recursive_bubble_sort

* Fixed doctest error due whitespace

* reduce loop times for optimization

* fixup! Format Python code with psf/black push

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
Du Yuanchao
2020-09-10 10:31:26 +02:00
committed by GitHub
co-authored by github-actions
parent 25946e4570
commit 4d0a8f2355
60 changed files with 900 additions and 859 deletions
+5 -5
View File
@@ -74,13 +74,13 @@ def modular_division2(a, b, n):
def extended_gcd(a, b):
"""
>>> extended_gcd(10, 6)
(2, -1, 2)
>>> extended_gcd(10, 6)
(2, -1, 2)
>>> extended_gcd(7, 5)
(1, -2, 3)
>>> extended_gcd(7, 5)
(1, -2, 3)
** extended_gcd function is used when d = gcd(a,b) is required in output
** extended_gcd function is used when d = gcd(a,b) is required in output
"""
assert a >= 0 and b >= 0