diff --git a/random.js b/random.js index 705f018..e594705 100644 --- a/random.js +++ b/random.js @@ -39,7 +39,7 @@ const breakDown = (node)=>{ return node; } -const tree = breakDown({value:8}); +const tree = breakDown({value:9}); console.dir(tree, {depth:null}); @@ -66,8 +66,8 @@ const getLeaves = (node)=>{ let threePathResult = []; if(node.threePath !== undefined){ - const threePathLeftValue = getLeaves(node.threePath.left);//3 - const threePathRightValue = getLeaves(node.threePath.right);//[[2,3],[3,2]] + const threePathLeftValue = getLeaves(node.threePath.left); + const threePathRightValue = getLeaves(node.threePath.right); if(Number.isInteger(threePathRightValue)){ threePathResult[0] = threePathLeftValue; threePathResult[1] = threePathRightValue;