Problem statement:
Write a function to print spiral order traversal of a tree.
For example.
Input -
10
J
H
I
A
C
D
F
E
B
G
where 10 is the number of elements in the input array.
Output -
A
BC
FED
GHIJ
Write a function to print spiral order traversal of a tree.
For example.
Input -
10
J
H
I
A
C
D
F
E
B
G
where 10 is the number of elements in the input array.
Output -
A
BC
FED
GHIJ
No comments:
Post a Comment