public DoublyLinkedListNode <T> FindLast(T value) { if (IsEmpty) { return(null); } DoublyLinkedListNode <T> current = head.prev; EqualityComparer <T> comparer = EqualityComparer <T> .Default; while (current != null && !comparer.Equals(current.item, value)) { current = current.prev; if (current == head) { return(null); } } return(current); }
private void InvalidateNode(DoublyLinkedListNode <T> node) { node.list = null; node.prev = null; node.next = null; }
public void Remove(DoublyLinkedListNode <T> node) { ValidateNode(node); RemoveNode(node); }