题解 | #25.二叉树的后序遍历#
二叉树的后序遍历
http://www.nowcoder.com/practice/1291064f4d5d4bdeaefbf0dd47d78541
后序
function postorderTraversal( root ) {
function postOrder(root){
if(root == null) return;
postOrder(root.left);
postOrder(root.right);
res.push(root.val);
}
let res = [];
postOrder(root);
return res;
}
module.exports = {
postorderTraversal : postorderTraversal
};
