public void AddLast(T value) { var element = new DoubleLinkedNode <T>(value); if (Count == 0) { First = element; Last = element; } else { var temp = Last; Last.Next = element; Last = element; element.Prev = temp; } Count++; }
public void AddFirst(T value) { var element = new DoubleLinkedNode <T>(value); var temp = First; element.Next = temp; First = element; if (Count == 0) { Last = First; } else { temp.Prev = First; } Count++; }