mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-04-07 14:25:54 +00:00
imrpoved del_node func(4)
This commit is contained in:
parent
f4c580027b
commit
c7c6efed9a
@ -10,7 +10,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import math
|
import math
|
||||||
import random
|
import random
|
||||||
from typing import Any
|
from typing import Any, Optional
|
||||||
|
|
||||||
|
|
||||||
class MyQueue:
|
class MyQueue:
|
||||||
@ -208,7 +208,7 @@ def get_min_value_node(node: MyNode) -> MyNode:
|
|||||||
return current
|
return current
|
||||||
|
|
||||||
|
|
||||||
def del_node(root: MyNode, data: Any) -> MyNode | None:
|
def del_node(root: Optional[MyNode], data: Any) -> Optional[MyNode]:
|
||||||
if root is None:
|
if root is None:
|
||||||
print("Nothing to delete")
|
print("Nothing to delete")
|
||||||
return None
|
return None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user