Is this the right way of deleting the tail from the linked list in c#
<p>Is this the right way of deleting the tail from the linked list in c# by simply setting the pointer to null.How do I actually free up the node. Do I need to implement Idispose </p>

<pre><code>public void DeleteTail()
    {
        if (head == null)
        {
            throw new InvalidOperationException("you cannot delete from an empty list.");
        }
        SingleLinkedListNode&lt;T&gt; current = head;

        while (current.Next.Next != null)
        {
            current = current.Next;
        }

        //delete the node
        current.Next = null;
    }

//Appends a node to the linked list
public  SingleLinkedListNode&lt;T&gt; AppendNode(T value)
    {
        SingleLinkedListNode&lt;T&gt; newNode = new SingleLinkedListNode&lt;T&gt;(value, null);
        if (head == null)
        {
            head = newNode;
        }
        else
        {
            SingleLinkedListNode&lt;T&gt; current = head;

            while (current.Next != null)
            {
                current = current.Next;
            }
            current.Next = newNode;
        }


        return newNode;
    }
</code></pre>
