How to delete the only node in a double linked list?
else if (head->next == NULL)
output = head->data;
delete head; //head is now invalid
`head' ends in an invalid state, set it to null.
also, you said that you return T, null may be not be a valid replacement.
Thank you good sir :)
Topic archived. No new replies allowed.