generate random tree using python

sweeper

New Member
How can I generate a random tree in python. I have an array from which I want to generate a random tree. I have the following code with me:\[code\]class Testcase(object): def generateRandomTree(depth, p): ''' depth = max length of path p = probability for another child on one level ''' raise NotImplementedError()def main(): t = Testcase(); t.generateRandomTree(3, 0.4)main()\[/code\]Can anyone tell me how can I generate random tree?
 
Back
Top