Hi.
I have a double linked list (queue) I have made on my own.
I am wondering, to clear the linked list, is it enough to simply remove the head and tail references?
E.g
public void Clear()
{
Head = null;
Tail = null;
}
I am imaging a domino effect, but I am having a hard time testing it. It WILL make the whole object appear empty atleast. All data requests (such as peek, dequeue etc.) returns null. You can also easily Enqueue some new objects. Purely functional it seems to be working.
But I'd really like to know if I am doing it the right way.