Created
December 27, 2019 07:22
-
-
Save AbhinavPradeep/44fb92e686421bbe2c7a279789725865 to your computer and use it in GitHub Desktop.
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
public void Add(Person person) | |
{ | |
Node node = CreateNode(person); | |
if (Head == null) | |
{ | |
Head = node; | |
return; | |
} | |
if(Head.Next == null) | |
{ | |
Head.Next = node; | |
return; | |
} | |
Node current = Head; | |
while(current.Next != null) | |
{ | |
current = current.Next; | |
} | |
current.Next = node; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment