Rename the naming of the coding files

in backtracking algorithm.
Add the typedef to docs.
This commit is contained in:
krahets
2023-04-22 01:38:53 +08:00
parent 9eeefff447
commit bad759b4f8
17 changed files with 98 additions and 98 deletions

View File

@ -1,5 +1,5 @@
"""
File: preorder_find_nodes.py
File: find_nodes-preorder.py
Created Time: 2023-04-15
Author: Krahets (krahets@163.com)
"""
@ -11,7 +11,7 @@ from modules import *
def pre_order(root: TreeNode) -> None:
"""前序遍历"""
"""前序遍历:例题一"""
if root is None:
return
if root.val == 7:

View File

@ -1,5 +1,5 @@
"""
File: preorder_find_paths.py
File: find_paths-preorder.py
Created Time: 2023-04-15
Author: Krahets (krahets@163.com)
"""
@ -11,7 +11,7 @@ from modules import *
def pre_order(root: TreeNode) -> None:
"""前序遍历"""
"""前序遍历:例题二"""
if root is None:
return
# 尝试

View File

@ -1,5 +1,5 @@
"""
File: preorder_find_constrained_path.py
File: find_constrained_paths_template.py
Created Time: 2023-04-15
Author: Krahets (krahets@163.com)
"""
@ -11,7 +11,7 @@ from modules import *
def pre_order(root: TreeNode) -> None:
"""前序遍历"""
"""前序遍历:例题三"""
# 剪枝
if root is None or root.val == 3:
return

View File

@ -1,5 +1,5 @@
"""
File: backtrack_find_constrained_path.py
File: find_constrained_paths_template.py
Created Time: 2023-04-15
Author: Krahets (krahets@163.com)
"""
@ -36,7 +36,7 @@ def undo_choice(state: list[TreeNode], choice: TreeNode):
def backtrack(state: list[TreeNode], choices: list[TreeNode], res: list[list[TreeNode]]):
"""回溯算法"""
"""回溯算法:例题三"""
# 检查是否为解
if is_solution(state):
# 记录解