Tree

Can someone help me how to construct a tree like this with recursion:

http://i.stack.imgur.com/uUnVi.png

The input for this example is 1 5 0 3. That means the the top node creates five children. The first child doesn't have any childred, but the second one has three.
up

You shouldn't really be bumping the post up.

Anyway, its always best that you at least try and do the code yourself before asking for help; we are not here to do your homework for you but are here to help you with any problems you may encounter while writing your code.

At least have a go :)
Topic archived. No new replies allowed.