Creation of generic Tree ?

asked 2023-02-16 14:45:09 +0100

aliosman9522 gravatar image

updated 2024-02-21 11:23:25 +0100

FrédéricC gravatar image

Hi, can i create a DAG- directed acyclic tree (not binary tree but generic)whose elements are instance of specific python class.

Pseudo code:

class x:
    def __init__(self,name):
          self.name=name

tree= Tree()
g1= tree.add_route(x("g1"))
g2=rt.add_node(x("g2"))
....

some thing like that ..

edit retag flag offensive close merge delete