I've been experimenting with creating some simple data structures, and once I tried making a linked list structure similar to the one that came with BMX. Basically, every item in the linked list has two variable references to 2 other items. I have a main type, List, and the items are of a type, Link.
Say my instance of List has a variable reference of the first Link in the list which is the first in the chain of links. Now these other links are not referenced in any other way besides the two in each link referencing the previous and next links. Only the first link is connected to the rest of my program by one variable in my instance of List. Say I nullify this one variable in List, and so these links are now just floating in space. They are connected to eachother, but not to the rest of the program. Since I cant access these any more because I deleted the reference to the first one, will they all automatically get deleted, or since they are still interconnected but not referenced by any other variable they will still be there?
Say my instance of List has a variable reference of the first Link in the list which is the first in the chain of links. Now these other links are not referenced in any other way besides the two in each link referencing the previous and next links. Only the first link is connected to the rest of my program by one variable in my instance of List. Say I nullify this one variable in List, and so these links are now just floating in space. They are connected to eachother, but not to the rest of the program. Since I cant access these any more because I deleted the reference to the first one, will they all automatically get deleted, or since they are still interconnected but not referenced by any other variable they will still be there?