IEnumerator <T> IEnumerable <T> .GetEnumerator() { LoopNode <T> current = Head; do { if (current != null) { yield return(current.Data); current = current.Next; } }while (current != Head); }
public void Add(T data) { LoopNode <T> node = new LoopNode <T>(data); // если список пуст if (Head == null) { Head = node; Tail = node; Tail.Next = Head; } else { node.Next = Head; Tail.Next = node; Tail = node; } count++; }