I just need a code that generates all n-ary trees of depth x. For example, if I input n=2, depth=3, all binary trees of depth 3, but if I input n=3 depth=5 then all ternary trees of depth 5.
A generated tree should be output in one line on console, such as the following example:
R-101 001 001-110 000 111 000 000 011 000 000 001
Remember, I want ALL generrated trees, not just one random tree
The above example, if I output it in multiple lines would probably make more sense:
101 001 001
110 000 111 000 000 011 000 000 001
Each "1" represents a node, while "0" represents no node. Notice that the root is always R, a single node. The above example is a simple ternary tree. from the next depth below the node, we always have N bits of 0 or 1, because it's all the possibilities.
I don't need the formula to count it, because the formula is obvious and I have it. I just need the one-line string outputs for the n-ary tree of depth x.
This is simple, just a long description, but maximum 20 lines of code.
Do not bid over budget, you will be ignored!
17 freelancers are bidding on average $28 for this job
I am well equip to this kind of task, can handle it pretty well. I already done related to this job before. Let me know the best of your time so we can discuss further based on your requirements.
Expertise in python and can provide you your complete task in decided time frame with quality work. We can discuss further details in the message box Regards
Hello, I have 8+ years of programming experience in Python. I am sure that I can write a Python script to generate n-ary trees of the specified depth. Best regards AWM.
Salut. Cred ca ma descurc sa va ajut eu cu proiectelul asta :) Puteti sa ma contactati si sunt sigur ca o sa gasim o solutie in cel mai scurt timp. Alex