Java Reference
In-Depth Information
The
pre-order
traversal of this tree
A
C
B
is
A B C
.
The
pre-order
traversal of this tree
C
G
E
N
B
A
F
J
K
H
is
C E F H B G A N J K
.
This is
in-order traversal
:
1.
Traverse the left subtree in in-order.
2.
Visit the root.
3.
Traverse the right subtree in in-order.
Here we traverse the left subtree first, then the root, and then the right subtree.
The
in-order
traversal of this tree
A
C
B
is
B A C
.
The
in-order
traversal of this tree
C
G
E
N
F
B
A
J
K
H
is
F H E B C A G J N K
Search WWH ::
Custom Search