Beispiel #1
0
 public LinkedListInt(params int[] values)
 {
     _first = null;
     foreach (var value in values)
     {
         Add(value);
     }
 }
Beispiel #2
0
 public bool MoveNext()
 {
     if (_current == null && _first != null)
     {
         _current = _first;
         return(true);
     }
     if (_current.Next == null)
     {
         return(false);
     }
     _current = _current.Next;
     return(true);
 }
Beispiel #3
0
 public void Reset()
 {
     _current = null;
 }
Beispiel #4
0
 public IEnumerator <int> GetEnumerator()
 {
     _current = null;
     return(this);
 }
Beispiel #5
0
 public void Add(int value)
 {
     _first = new IntNode(_first, value);
 }
 public IntNode(IntNode next, int value)
 {
     Next  = next;
     Value = value;
 }