Skip to content

Instantly share code, notes, and snippets.

@AbhinavPradeep
Created December 31, 2019 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AbhinavPradeep/8a1f3323f8c924ac3f3ddbf904604f96 to your computer and use it in GitHub Desktop.
Save AbhinavPradeep/8a1f3323f8c924ac3f3ddbf904604f96 to your computer and use it in GitHub Desktop.
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