1
Save everyone, I’m learning chained list in python, as I already have some knowledge of list in C hit me doubt about node removal, the basis of the algorithms I used in some exercises is this:
Algorithm remove_first(L):
if L.head is None then
Indicate an error: the list is empty.
L.head = L.head.next
L.size = L.size−1
I had a question about a memory leak. As the removal of nodes apparently works only with a pointer exchange, I was left with doubt whether the memory, with this exchange, is allocated and inaccessible or not, if the exchange already makes available the memory? I thought of the C function free, is there any analog method in python to make memory available? If the case.