Created
January 5, 2017 01:30
-
-
Save dzsquared/fb8326be4777c38f86c8bf2a4fc568d5 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
public static Node insert(Node head,int data) | |
{ | |
//Complete this method | |
if(head == null) | |
return new Node( data); | |
else if(head.next == null){ | |
head.next = new Node(data); | |
} | |
else{ | |
insert(head.next,data); | |
} | |
return head; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment