mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 04:31:55 +08:00
refactor: Replace 结点 with 节点 (#452)
* Replace 结点 with 节点 Update the footnotes in the figures * Update mindmap * Reduce the size of the mindmap.png
This commit is contained in:
@ -9,10 +9,10 @@ from collections import deque
|
||||
class TreeNode:
|
||||
""" Definition for a binary tree node """
|
||||
def __init__(self, val: int = 0):
|
||||
self.val: int = val # 结点值
|
||||
self.height: int = 0 # 结点高度
|
||||
self.left: TreeNode | None = None # 左子结点引用
|
||||
self.right: TreeNode | None = None # 右子结点引用
|
||||
self.val: int = val # 节点值
|
||||
self.height: int = 0 # 节点高度
|
||||
self.left: TreeNode | None = None # 左子节点引用
|
||||
self.right: TreeNode | None = None # 右子节点引用
|
||||
|
||||
def list_to_tree(arr: list[int]) -> TreeNode | None:
|
||||
""" Generate a binary tree with a list """
|
||||
|
||||
@ -7,8 +7,8 @@ Author: Krahets (krahets@163.com)
|
||||
class ListNode:
|
||||
""" Definition for a singly-linked list node """
|
||||
def __init__(self, val: int):
|
||||
self.val: int = val # 结点值
|
||||
self.next: ListNode | None = None # 后继结点引用
|
||||
self.val: int = val # 节点值
|
||||
self.next: ListNode | None = None # 后继节点引用
|
||||
|
||||
def list_to_linked_list(arr: list[int]) -> ListNode | None:
|
||||
""" Generate a linked list with a list """
|
||||
|
||||
Reference in New Issue
Block a user