kaushikdev9
BAN USER
Questions (1)
Comments (3)
Reputation 10
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
@Godel sry abt the bad tree diagram but I think its not very hard to understand the question without the diagram. Is it?
Forget about the example given in the question, just imagine any tree and try to print the nodes you encounter when you move from left to right. If there are more than one nodes that are available in a given vertical line then print it from top to bottom.
Comment hidden because of low score. Click to expand.
0
of 0 vote
sry abt the bad tree structure
Root Node: 1
Left Child of 1: 2
Right Child of 1: 3
Left Child of 2: 4
Left Child of 3: 5
Right Child of 5: 6
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
When there are more than one nodes at a level, print from top to bottom
- kaushikdev9 October 13, 2012