|
|
|
@ -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.
|
|
|
|
|
|
|
|
|
|