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

Add ancestor method to class Tree & corresponding test #100

Closed FloLangenfeld closed 4 years ago

FloLangenfeld commented 5 years ago

Add a new method to class Tree to find ancestor at a given level, and the corresponding test function. Ex: my_tree.ancestor(nid, level=1) will return, for node nid, the ancestor of level 1 from my_tree

caesar0301 commented 4 years ago

This is merge by #125 manually due to conflicts. Thanks @FloLangenfeld