Created
November 4, 2014 15:17
-
-
Save Gofilord/ee2336d3a1ec2fca3b78 to your computer and use it in GitHub Desktop.
Creating a chain without array
This file contains 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
Node<Integer> lastNode = new Node<Integer>(rndVal, null); | |
Node<Integer> nextNode = new Node<Integer>(rndVal - 1, lastNode); | |
for (int i = rndVal - 2; i >= 0; i--) | |
nextNode = new Node<Integer>(i, nextNode); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment