Skip to content

Instantly share code, notes, and snippets.

View JonBeyond's full-sized avatar

Jonathan JonBeyond

  • San Francisco, CA
View GitHub Profile
@JonBeyond
JonBeyond / README.md
Created January 28, 2019 18:28 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
/* 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