什么是二叉树?
前序遍历
中左右
递归
1 | var preorderTraversal = function (root) => { |
9 6 8
迭代
1 | var preorderTraversal = function(root) => { |
中序遍历
左中右
递归
1 | var preorderTraversal = function(root) => { |
迭代
1 | var preorderTraversal = function(root) => { |
什么是二叉树?
中左右
1 | var preorderTraversal = function (root) => { |
9 6 8
1 | var preorderTraversal = function(root) => { |
左中右
1 | var preorderTraversal = function(root) => { |
1 | var preorderTraversal = function(root) => { |