Recursion

Date: April 21, 2023

Topic: Recursion

Recall

Recursion 与 1D or 2D Array结合

1.1 8 x 8 queen

Recursion 与Linked List结合

pair by pair

reverse a binary tree upside down

recursion与Tree结合

LAC

Notes

<aside> 📌 SUMMARY:

</aside>

Date: May 15, 2023

Topic: Recursion 小灶

Recall

如何理解tree问题三部曲Recursion和DFS的区别

Q1:Binary Tree Path

Notes

DFS问题的两个解法,回答两个问题

DFS和recursion的区别是构建解的顺序不一样

Step 1: Function能做什么

List<String> binaryTreePaths(TreeNode root)给我一个root节点,我能返回所有从root出发到各个leaf node path

Step 2: Base case

root == null, return empty list

root is leaf, return list of itself

Step 3: subproblem

root.left

root.right

Step 4: Recursion rule

Difference between Recursion and DFS

<aside> 📌 SUMMARY:

</aside>

Date: May 15, 2023

Topic: Recursion III

Recall

Q1. Tree + Recursion 第一类问题

Summary of tree path description

path problem in binary tree

<aside> 📌 SUMMARY:

</aside>