Skip to content

Commit ea86257

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 02c9f88 commit ea86257

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

divide_and_conquer/closest_pair_of_points.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
1919
Time complexity: O(n * log n)
2020
"""
21+
2122
from __future__ import annotations
2223

2324
from typing import Any
2425

2526

26-
def euclidean_distance_sqr(point1: list[Any] | tuple[Any, ...], point2: list[Any] | tuple[Any, ...]) -> float:
27+
def euclidean_distance_sqr(
28+
point1: list[Any] | tuple[Any, ...], point2: list[Any] | tuple[Any, ...]
29+
) -> float:
2730
"""
2831
>>> euclidean_distance_sqr([1, 2], [2, 4])
2932
5
@@ -39,7 +42,9 @@ def column_based_sort(array: list[Any], column: int = 0) -> list[Any]:
3942
return sorted(array, key=lambda x: x[column])
4043

4144

42-
def dis_between_closest_pair(points: list[Any], points_counts: int, min_dis: float = float("inf")) -> float:
45+
def dis_between_closest_pair(
46+
points: list[Any], points_counts: int, min_dis: float = float("inf")
47+
) -> float:
4348
"""
4449
brute force approach to find distance between closest pair points
4550
@@ -61,7 +66,9 @@ def dis_between_closest_pair(points: list[Any], points_counts: int, min_dis: flo
6166
return min_dis
6267

6368

64-
def dis_between_closest_in_strip(points: list[Any], points_counts: int, min_dis: float = float("inf")) -> float:
69+
def dis_between_closest_in_strip(
70+
points: list[Any], points_counts: int, min_dis: float = float("inf")
71+
) -> float:
6572
"""
6673
closest pair of points in strip
6774
@@ -82,7 +89,9 @@ def dis_between_closest_in_strip(points: list[Any], points_counts: int, min_dis:
8289
return min_dis
8390

8491

85-
def closest_pair_of_points_sqr(points_sorted_on_x: list[Any], points_sorted_on_y: list[Any], points_counts: int) -> float:
92+
def closest_pair_of_points_sqr(
93+
points_sorted_on_x: list[Any], points_sorted_on_y: list[Any], points_counts: int
94+
) -> float:
8695
"""divide and conquer approach
8796
8897
Parameters :

0 commit comments

Comments
 (0)