public void RemoveLast()
        {
            if (Count == 0)
            {
                return;
            }

            if (Count == 1)
            {
                Head = null;
                Tail = null;
            }
            else
            {
                var current = Head;
                while (current.Next != Tail)
                {
                    current = current.Next;
                }

                current.Next = null;
                Tail         = current;
            }
            Count--;
        }
        public IEnumerator <T> GetEnumerator()
        {
            CustomNode.LinkedListNode <T> current = Head;
            while (current != null)
            {
                yield return(current.Value);

                current = current.Next;
            }
        }
        public void AddFirst(CustomNode.LinkedListNode <T> node)
        {
            node.Next = Head;
            Head      = node;
            Count++;

            if (Count == 1)
            {
                Tail = Head;
            }
        }
 public void RemoveFirst()
 {
     if (Count != 0)
     {
         Head = Head.Next;
         Count--;
         if (Count == 0)
         {
             Tail = null;
         }
     }
 }
        public void AddLast(CustomNode.LinkedListNode <T> node)
        {
            if (Count == 0)
            {
                Head = node;
            }
            else
            {
                Tail.Next = node;
            }

            Tail = node;
            Count++;
        }
        public bool Remove(T item)
        {
            var current = Head;

            CustomNode.LinkedListNode <T> previous = null;
            //1. Empty List - do nothing.
            //2. Single Node: previous is null.
            //3. Multiple Nodes:
            //   a. node to remove is first.
            //   b. note to remove is the middle or last.
            while (current != null)
            {
                if (current.Value.Equals(item))
                {
                    if (previous != null)
                    {
                        previous.Next = current.Next;
                        if (current.Next == null)
                        {
                            Tail = current;
                        }

                        Count--;
                    }
                    else
                    {
                        RemoveFirst(); //case 2, 3a
                    }

                    return(true);
                }

                previous = current;
                current  = current.Next;
            }

            return(false);
        }