Last active
November 17, 2016 14:51
-
-
Save PradeepLoganathan/b02da8d448d6a49c798083958fd27a8b to your computer and use it in GitHub Desktop.
Recursively printing a singly linked list
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
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