-
-
Save AbhinavPradeep/8a1f3323f8c924ac3f3ddbf904604f96 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 Remove(string name) | |
{ | |
if (Head == null) | |
return; | |
Node Current; | |
Current = Head; | |
if (Head.person.Name == name) | |
{ | |
Head = null; | |
} | |
if (Head.person.Name != name) | |
{ | |
while (Current.Next.person.Name != name) | |
{ | |
Current = Current.Next; | |
} | |
if (Current.Next.person.Name == name) | |
{ | |
Current.Next = Current.Next.Next; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment