Sunday, 14 May 2017

C# - Printing the result of Double LinkedList

I have a Double LinkedList that I want to print using consoleWriteLine to see the result of the linkedList. Tthe problem I have is that I know how to print a list with just a Next node in terms of the stopping condition (which is when node.next is null), but this is a double linked list with both Next and Previous. Where every node in the list connect's to other node so there are no node.next == null.

What is the stopping condition in this type of list? Right now I have an infinite loop that printing the list over and over.



via Dolev

No comments:

Post a Comment