Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 private void InvalidateNode(DoublyLinkedListNode <T> node)
 {
     node.list = null;
     node.prev = null;
     node.next = null;
 }
Exemplo n.º 3
0
 public void Remove(DoublyLinkedListNode <T> node)
 {
     ValidateNode(node);
     RemoveNode(node);
 }