void TraverseLinkedList() { SimpleLinkedListNode node = head; while (node != null) { Console.Write(node._data + " "); node = node._next; } }
public SimpleLinkedList() { SimpleLinkedList first = new SimpleLinkedList(); first.head = new SimpleLinkedListNode(1); SimpleLinkedListNode second = new SimpleLinkedListNode(2); SimpleLinkedListNode third = new SimpleLinkedListNode(3); first.head._next = second; second._next = third; first.TraverseLinkedList(); }
public SimpleLinkedListNode(int data) { _data = data; _next = null; }