Processing code for creating a randomly generated tree based on simple recursive tree structure