mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
contribution guidelines checks (#1787)
* spelling corrections * review * improved documentation, removed redundant variables, added testing * added type hint * camel case to snake case * spelling fix * review * python --> Python # it is a brand name, not a snake * explicit cast to int * spaces in int list * "!= None" to "is not None" * Update comb_sort.py * various spelling corrections in documentation & several variables naming conventions fix * + char in file name * import dependency - bug fix Co-authored-by: John Law <johnlaw.po@gmail.com>
This commit is contained in:
@@ -344,19 +344,19 @@ def convex_hull_recursive(points):
|
||||
right_most_point = points[n - 1]
|
||||
|
||||
convex_set = {left_most_point, right_most_point}
|
||||
upperhull = []
|
||||
lowerhull = []
|
||||
upper_hull = []
|
||||
lower_hull = []
|
||||
|
||||
for i in range(1, n - 1):
|
||||
det = _det(left_most_point, right_most_point, points[i])
|
||||
|
||||
if det > 0:
|
||||
upperhull.append(points[i])
|
||||
upper_hull.append(points[i])
|
||||
elif det < 0:
|
||||
lowerhull.append(points[i])
|
||||
lower_hull.append(points[i])
|
||||
|
||||
_construct_hull(upperhull, left_most_point, right_most_point, convex_set)
|
||||
_construct_hull(lowerhull, right_most_point, left_most_point, convex_set)
|
||||
_construct_hull(upper_hull, left_most_point, right_most_point, convex_set)
|
||||
_construct_hull(lower_hull, right_most_point, left_most_point, convex_set)
|
||||
|
||||
return sorted(convex_set)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user