I was reviewing the code at the following two sites. I noticed that memory allocation "new" has been used to allocate space for the Node(s). How are they freed?. very good codes.


Memory allocated with new can be de-allocated with delete
Wikipedia Article
One thing to note is that array allocated with new[] must be deallocated with delete[]

int integer = new int;
int* pointer = &integer;
delete pointer;