mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-17 14:58:10 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
851c740d21
commit
1f470e7932
|
@ -22,8 +22,7 @@ def distance(a: Point, b: Point) -> float:
|
|||
is {distance(point1, point2)}")
|
||||
Distance from Point(2, -1, 7) to Point(1, -3, 5) is 3.0
|
||||
"""
|
||||
return math.sqrt(abs((b.x - a.x) ** 2 + (b.y - a.y) ** 2
|
||||
+ (b.z - a.z) ** 2))
|
||||
return math.sqrt(abs((b.x - a.x) ** 2 + (b.y - a.y) ** 2 + (b.z - a.z) ** 2))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
@ -35,8 +35,7 @@ def quick_sort(collection: list) -> list:
|
|||
|
||||
lesser_partition, greater_partition = partition(collection, pivot)
|
||||
|
||||
return [*quick_sort(lesser_partition), pivot,
|
||||
*quick_sort(greater_partition)]
|
||||
return [*quick_sort(lesser_partition), pivot, *quick_sort(greater_partition)]
|
||||
|
||||
|
||||
def partition(collection: list, pivot) -> tuple[list, list]:
|
||||
|
|
Loading…
Reference in New Issue
Block a user