Depth-first Search Depth-first Search Topic 1

104. Maximum Depth of Binary Tree

Idea: Follow a branch of the tree to the number of layers until the leaf node. The idea of ​​DFS. This problem can be practiced recursively.
code

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324885836&siteId=291194637