Getting started:
Related tutorials:
| /* Input: a binary tree | |
| * Output: the side of the tree with the largest quantity of nodes below it | |
| * Edge case: a tie, return the lowest depth winner | |
| * | |
| * Problem analysis: | |
| * At each node, we need to recursively sum all values at each depth. | |
| * | |
| * Problem Solution: | |
| * 1. Declare an object that will keep track of: 1) the depth, 2) a sum of the values at that depth | |
| * 2. Recursively penetrate the tree, adding any values to it's respective depth value |
Getting started:
Related tutorials: