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: 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: