public void Remove(T Data) { if (Head.Data.Equals(Data)) { Head.Next.Previous = Head.Previous; Head.Previous.Next = Head.Next; Head = Head.Next; return; } var current = Head.Next; for (int i = 0; i < count; i++) { if (current.Data.Equals(Data)) { current.Next.Previous = current.Previous; current.Previous.Next = current.Next; count--; return; } current = current.Next; } }
private void SetHeadItem(T data) { Head = new DuplexItem <T>(data); Head.Next = Head; Head.Previous = Head; Count = 1; }
private void RemoveItem(DuplexItem <T> current) { current.Next.Previous = current.Previous; current.Previous.Next = current.Next; Count--; return; }
public DuplexLinkedList(T data) { var item = new DuplexItem <T>(data); Head = item; Tail = item; Count = 1; }
public void setDefault(T Data) { DuplexItem <T> item = new DuplexItem <T>(Data); Head = item; Tail = item; count = 1; }
private void Set(T data) { var item = new DuplexItem <T>(data); Head = item; Tail = item; Count = 1; return; }
public void setDefault(T Data) { var item = new DuplexItem <T>(Data); Head = item; Head.Next = Head; Head.Previous = Head; count = 1; }
public void Add(T Data) { if (count == 0) { setDefault(Data); return; } var item = new DuplexItem <T>(Data); Tail.Next = item; item.Previous = Tail; Tail = item; count++; }
public void Add(T Data) { if (count == 0) { setDefault(Data); return; } var item = new DuplexItem <T>(Data); item.Next = Head; item.Previous = Head.Previous; Head.Previous.Next = item; Head.Previous = item; count++; }
public void Add(T data) { if (Count == 0) { SetHeadItem(data); return; } var item = new DuplexItem <T>(data); item.Next = Head; item.Previous = Head.Previous; Head.Previous.Next = item; Head.Previous = item; Count++; }
public void Add(T data) { var item = new DuplexItem <T>(data); if (Count == 0) { Head = item; Tail = item; Count = 1; return; } Tail.Next = item; item.Previous = Tail; Tail = item; Count++; }
public void Add(T data) { if (Count != 0) { var item = new DuplexItem <T>(data); Tail.Next = item; item.Previous = Tail; Tail = item; Count++; return; } else { Set(data); return; } }
private void RemoveItem(DuplexItem <T> current) { current.Next.Previos = current.Previos; current.Previos.Next = current.Next; Count--; }