I\'m writing an algorithm which creates a tree that contains n number of nodes with random (0..1) weights (a.k.a the value of the node). Simply a structure like