From 75b20c1ea46515b151069c23ff951ccacdfb8e4f Mon Sep 17 00:00:00 2001 From: ben <847511885@qq.com> Date: Tue, 9 May 2023 23:25:40 +0800 Subject: [PATCH 1/2] Fix #8715 Update the remove func of binary search tree. --- data_structures/binary_tree/binary_search_tree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_structures/binary_tree/binary_search_tree.py b/data_structures/binary_tree/binary_search_tree.py index cd88cc10e697..c72195424c7c 100644 --- a/data_structures/binary_tree/binary_search_tree.py +++ b/data_structures/binary_tree/binary_search_tree.py @@ -40,7 +40,7 @@ def __reassign_nodes(self, node: Node, new_children: Node | None) -> None: else: node.parent.left = new_children else: - self.root = None + self.root = new_children def is_right(self, node: Node) -> bool: if node.parent and node.parent.right: From f4d1cba382194de6e424d178e16f4fea50710310 Mon Sep 17 00:00:00 2001 From: ben <847511885@qq.com> Date: Fri, 12 May 2023 17:31:36 +0800 Subject: [PATCH 2/2] Update the ruff's validation error --- maths/euclidean_distance.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/maths/euclidean_distance.py b/maths/euclidean_distance.py index 22012e92c9cf..95a59c762329 100644 --- a/maths/euclidean_distance.py +++ b/maths/euclidean_distance.py @@ -1,12 +1,11 @@ from __future__ import annotations from collections.abc import Iterable -from typing import Union import numpy as np -Vector = Union[Iterable[float], Iterable[int], np.ndarray] -VectorOut = Union[np.float64, int, float] +Vector = Iterable[float] | Iterable[int] | np.ndarray +VectorOut = np.float64 | int | float def euclidean_distance(vector_1: Vector, vector_2: Vector) -> VectorOut: