Пример #1
0
        public void AddToStart(T item)
        {
            SimpleLinkedListNode <T> node = new SimpleLinkedListNode <T>(item);

            node.Next = head;
            head      = node;
        }
Пример #2
0
        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;
            }
        }
Пример #3
0
 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);
 }
Пример #4
0
 public void Reset()
 {
     _current = null;
 }