Print Levelwise
Given a binary tree, print the tree in level wise order.
Given a binary tree, print the tree in level wise order.
N:L:x,R:y
Elements in level order form (separated by space)
(If any node does not have left or right child, take -1 in its place)
8 3 10 1 6 -1 14 -1 -1 4 7 13 -1 -1 -1 -1 -1 -1 -1
8:L:3,R:10
3:L:1,R:6
10:L:-1,R:14
1:L:-1,R:-1
6:L:4,R:7
14:L:13,R:-1
4:L:-1,R:-1
7:L:-1,R:-1
13:L:-1,R:-1
Comments
Post a Comment
Please give us your valuable feedback