Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const findLargestLevel = function(node) {
- //set a variable to hold the largest sum;
- var largestSum = 0;
- //set a variable to hold the current sum
- var currentSum = 0;
- // search the tree
- //check the node, if there's children
- //sum the children values
- //compare with the largest sum
- //if larger, overwrite with the new sum
- return largestSum
- //return the largest sum
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement