caesar0301 / treelib

An efficient implementation of tree data structure in python 2/3.
http://treelib.readthedocs.io/en/latest/
Other
801 stars 185 forks source link

#87 tree merge feature #138

Closed leonardbinet closed 4 years ago

leonardbinet commented 4 years ago

Another type of pasting:

Given the following trees: current

root
├── A
└── B

new_tree

root2
├── C
└── D
    └── D1

Pasting new_tree on B node:

current.paste('B', new_tree)
current.show()
root
├── A
└── B
    └── root2
        ├── C
        └── D
            └── D1

Merging new_tree on B node:

current.merge('B', new_tree)
current.show()
root
├── A
└── B
    ├── C
    └── D
        └── D1
leonardbinet commented 4 years ago

@caesar0301 what do you think of such an option?

leonardbinet commented 4 years ago

@caesar0301 I've kept appart both methods for clarity.