Hello,
"If do, how can I release the memory of an int list? Deallocate
the int list or deallocate the int node one by one?"
Nullifying a pointer does nothing to release the memory--it may simply
produce a memory leak. Therefore, you must *explicitly* have a
DEALLOCATE statement for every ALLOCATE statement. So if you allocate
your list of nodes one by one, then you should deallocate them one by
one. Deallocating the head and tail nodes in particular is not
"deallocating the list".
Best,
Aleksandar
|