public void AddToStart(T item) { SimpleLinkedListNode <T> node = new SimpleLinkedListNode <T>(item); node.Next = head; head = node; }
public void Add(T item) { SimpleLinkedListNode <T> node = new SimpleLinkedListNode <T>(item); if (head == null) { head = node; } else { var current = head; while (current.Next != null) { current = current.Next; } current.Next = node; } }
public bool MoveNext() { if (_current == null && _list.head != null) { _current = _list.head; } else if (_current == null) { return(false); } else { _current = _current.Next; } if (_current == null) { return(false); } return(true); }
public void Reset() { _current = null; }