Skip to content

Instantly share code, notes, and snippets.

@PradeepLoganathan
Last active November 17, 2016 14: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 PradeepLoganathan/b02da8d448d6a49c798083958fd27a8b to your computer and use it in GitHub Desktop.
Save PradeepLoganathan/b02da8d448d6a49c798083958fd27a8b to your computer and use it in GitHub Desktop.
Recursively printing a singly linked list
void IPrintLinkedList.PrintLinkedList()
{
PrintNode(_head);
}
void PrintNode(ISinglyLinkedNode<T> Node)
{
if (Node == null)
{
Debug.Write(" | " + "NULL"+ " | " + "\n");
return;
}
Debug.Write(" | " + Node.Data + " | " + "-->");
PrintNode(Node.Next);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment