removing comments

master
Matthew Huntington 3 years ago
parent 64fa180f6e
commit 75a5a1be00

@ -39,7 +39,7 @@ const breakDown = (node)=>{
return node; return node;
} }
const tree = breakDown({value:5}); const tree = breakDown({value:7});
console.dir(tree, {depth:null}); console.dir(tree, {depth:null});
@ -49,13 +49,12 @@ const getLeaves = (node)=>{
} }
let twoPathResult = []; let twoPathResult = [];
const twoPathLeftValue = getLeaves(node.twoPath.left); //2 const twoPathLeftValue = getLeaves(node.twoPath.left);
const twoPathRightValue = getLeaves(node.twoPath.right); //[[2,3],[3,2]] const twoPathRightValue = getLeaves(node.twoPath.right);
if(Number.isInteger(twoPathRightValue)){ if(Number.isInteger(twoPathRightValue)){
twoPathResult[0] = twoPathLeftValue; twoPathResult[0] = twoPathLeftValue;
twoPathResult[1] = twoPathRightValue; twoPathResult[1] = twoPathRightValue;
} else { } else {
//[2] [[2,3],[3,2]]
twoPathRightValue[0].unshift(twoPathLeftValue) twoPathRightValue[0].unshift(twoPathLeftValue)
twoPathRightValue[1].unshift(twoPathLeftValue); twoPathRightValue[1].unshift(twoPathLeftValue);
twoPathResult = twoPathRightValue; twoPathResult = twoPathRightValue;

Loading…
Cancel
Save