having to deal with lots (potentially hundreds of thousands) of nodes containing data
having to generate multiple subtrees without impacting initial tree
The only solution I had was to create for each subtree a deepcopy, but it was very greedy and expensive in terms of memory.
This pull-request implements the ability to generate shallow copies of trees (no deep-copy of nodes), and mutate multiple shallow copies of the same tree without impacting other trees hierarchies.
I do so by assigning Nodes not a single _bpointer_fpointer, but one per shallow copy of tree.
I encountered the following conditions:
The only solution I had was to create for each subtree a deepcopy, but it was very greedy and expensive in terms of memory.
This pull-request implements the ability to generate shallow copies of trees (no deep-copy of nodes), and mutate multiple shallow copies of the same tree without impacting other trees hierarchies.
I do so by assigning
Nodes
not a single_bpointer
_fpointer
, but one per shallow copy of tree.