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