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.
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.