public void AddFirst(T value)
        {
            var node = new LinkedListNodeDoubly <T>(value)
            {
                Prev = null, Next = Head
            };

            Head.Prev = node;
            Head      = node;
        }
 public void RemoveFirst()
 {
     if (Head != null)
     {
         var nodeNext = Head.Next;
         nodeNext.Prev = null;
         Head          = null;
         Head          = nodeNext;
     }
 }
        public void Clear()
        {
            Head = null;

            // TODO: Necessary?
            var node = Head;

            while (node != null)
            {
                node = node.Next;
                if (node != null)
                {
                    node.Prev = null;
                    node.Next = null;
                }
            }
        }
        public void AddAfter(T value, T existing)
        {
            var node = Head;

            while (node != null)
            {
                if (node.Value.Equals(existing))
                {
                    var newNode = new LinkedListNodeDoubly <T>(value)
                    {
                        Prev = node, Next = node.Next
                    };
                    node.Next = newNode;
                    return;
                }

                node = node.Next;
            }
        }
        public void AddLast(T value)
        {
            var node = new LinkedListNodeDoubly <T>(value);

            if (Head == null)
            {
                Head = node;
            }
            else
            {
                var n = Head;
                while (n != null)
                {
                    if (n.Next == null)
                    {
                        n.Next    = node;
                        node.Prev = n;
                        break;
                    }

                    n = n.Next;
                }
            }
        }
 public LinkedListDoubly(LinkedListNodeDoubly <T> node)
 {
     Head = node;
 }