![「数据结构」树的遍历](https://cdn.portal.levenx.com/levenx-world/qt-AsRviWH71WhWl.png)
「数据结构」树的遍历
![乐闻的头像](https://cdn.portal.levenx.com/levenx-world/ghY0PdpLg5jTOhB9.jpg)
javascriptfunction dfs(root){ //do sth dfs(root.left); dfs(root.right); }
javascriptfunction dfs(root){ dfs(root.left); //do sth dfs(root.right); }
javascriptfunction dfs(root){ dfs(root.left); dfs(root.right); //do sth }
javascriptfunction dfs(root){ //do sth dfs(root.left); dfs(root.right); }
javascriptfunction dfs(root){ dfs(root.left); //do sth dfs(root.right); }
javascriptfunction dfs(root){ dfs(root.left); dfs(root.right); //do sth }