Created
September 19, 2016 00:39
-
-
Save dcapwell/12a05105680d2337e8439bf26f93a99c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pre-create nodes so its easier to link them together | |
// add n to first nodes just to make the loop simple | |
Node[] nodes = new Node[targetLevel + 1]; | |
nodes[0] = n; | |
for (int i = 1; i <= targetLevel; i++) | |
nodes[i] = new Node(value, null, nodes[i - 1]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment