mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 17:34:49 +08:00
refactor: Indent ... for visual purposes (#7744)
This commit is contained in:

committed by
GitHub

parent
e8915097c4
commit
9bba42eca8
@ -196,7 +196,7 @@ def binary_search_tree() -> None:
|
||||
1 4 7 6 3 13 14 10 8
|
||||
>>> BinarySearchTree().search(6)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
...
|
||||
IndexError: Warning: Tree is empty! please use another.
|
||||
"""
|
||||
testlist = (8, 3, 6, 1, 10, 14, 13, 4, 7)
|
||||
|
@ -21,11 +21,11 @@ def binary_tree_mirror(binary_tree: dict, root: int = 1) -> dict:
|
||||
{1: [3, 2], 2: [5, 4], 3: [7, 6], 4: [11, 10]}
|
||||
>>> binary_tree_mirror({ 1: [2,3], 2: [4,5], 3: [6,7], 4: [10,11]}, 5)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
...
|
||||
ValueError: root 5 is not present in the binary_tree
|
||||
>>> binary_tree_mirror({}, 5)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
...
|
||||
ValueError: binary tree cannot be empty
|
||||
"""
|
||||
if not binary_tree:
|
||||
|
@ -67,7 +67,7 @@ def factorial(n: int) -> int:
|
||||
True
|
||||
>>> factorial(-5) # doctest: +ELLIPSIS
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
...
|
||||
ValueError: factorial() not defined for negative values
|
||||
"""
|
||||
if n < 0:
|
||||
|
Reference in New Issue
Block a user