[Algorithm] 34 week(9.19 ~ 9.25) 1/3

Dev_min·2022년 9월 19일
0

algorithm

목록 보기
111/157

94. Binary Tree Inorder Traversal

var inorderTraversal = function(root) {
    const result=[];
    inorder(root);
    
    function inorder(root) {
        if(!root) return null;
        
        inorder(root.left);
        
        result.push(root.val);
        
        inorder(root.right);
    }
    
    return result;    
};
profile
TIL record

0개의 댓글