mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2026-02-03 02:24:47 +08:00
@@ -490,7 +490,7 @@ Recursion is a common approach for trees. When you notice that the subtree probl
|
||||
|
||||
When using recursion, always remember to check for the base case, usually where the node is `null`.
|
||||
|
||||
When you are asked to traverse a tree by level, use depth first search.
|
||||
When you are asked to traverse a tree by level, use breadth-first search.
|
||||
|
||||
Sometimes it is possible that your recursive function needs to return two values.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user