IEnumerator <SecondList> IEnumerable <SecondList> .GetEnumerator() { SecondNode <SecondList> current = head; while (current != null) { yield return(current.Data); current = current.Next; } }
public void Add(SecondList data) { var node = new SecondNode <SecondList>(data); if (head == null) { head = node; } else { tail.Next = node; node.Previous = tail; } tail = node; count++; }
public void AddFirst(SecondList data) { var node = new SecondNode <SecondList>(data); SecondNode <SecondList> temp = head; node.Next = temp; head = node; if (count == 0) { tail = head; } else { temp.Previous = node; } count++; }
public void Clear() { head = null; tail = null; count = 0; }