mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-09-29 17:08:49 +08:00
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:
co-authored by
github-actions
parent
25946e4570
commit
4d0a8f2355
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user