Polish the chapter of graph, hashing, appendix

This commit is contained in:
krahets
2023-04-09 03:09:06 +08:00
parent 56243ccc5b
commit 3f4e32b2b0
16 changed files with 151 additions and 151 deletions

View File

@@ -13,7 +13,7 @@ List<int> list = [];
/* 前序遍历 */
void preOrder(TreeNode? node) {
if (node == null) return;
// 访问优先级:根点 -> 左子树 -> 右子树
// 访问优先级:根点 -> 左子树 -> 右子树
list.add(node.val);
preOrder(node.left);
preOrder(node.right);
@@ -22,7 +22,7 @@ void preOrder(TreeNode? node) {
/* 中序遍历 */
void inOrder(TreeNode? node) {
if (node == null) return;
// 访问优先级:左子树 -> 根点 -> 右子树
// 访问优先级:左子树 -> 根点 -> 右子树
inOrder(node.left);
list.add(node.val);
inOrder(node.right);
@@ -31,7 +31,7 @@ void inOrder(TreeNode? node) {
/* 后序遍历 */
void postOrder(TreeNode? node) {
if (node == null) return;
// 访问优先级:左子树 -> 右子树 -> 根
// 访问优先级:左子树 -> 右子树 -> 根
postOrder(node.left);
postOrder(node.right);
list.add(node.val);