avatar

inorder

const inorderTraversal = root => {
if (!root) {
return []
}

return [...inorderTraversal(root.left), root.val, ...inorderTraversal(root.right)]

}


Comment