private void SetHeadItem(T data) { var item = new DuplexItem <T>(data); head = item; tail = item; Count = 1; }
public void PushFront(T data) { if (Count == 0) { SetHeadItem(data); return; } var item = new DuplexItem <T>(data); item.Previous = head; tail.Next = item; head = item; Count++; }
public void PushBack(T data) { if (Count == 0) { SetHeadItem(data); return; } var item = new DuplexItem <T>(data); item.Next = tail; tail.Previous = item; tail = item; Count++; }