Here's the deal. I've got a "tree" or a "subtree" that I want to navigate and delete every element in. Each "node" may contain links to other nodes below it (no problem) OR may contain links OUTSIDE that particular "tree"/"subtree". How can I build a function that only deletes "within" the specified tree?
This is the same recursive delete that you're used to. You just have to keep your links separated - one list for in-tree links, one for out-of-tree links. Alternately, you can have a flag that keeps track of the in-tree/out-of-tree state for each link - but you're going to have to distinguish when you make the link.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With