Tree Traversal Algorithm Animations
Navigation System:
Step Navigator
Inorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse current node
Traverse the right subtree
Current Status:
Now algorithm is in node A.
Node A has left node.
The algorithm calls Left Child Node for Traversal.
Current node moves to B
Traversed List:
{}
Inorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse current node
Traverse the right subtree
Current Status:
Now algorithm is in node B.
Node B has left node.
The algorithm calls Left Child Node for Traversal.
Current node moves to D
Traversed List:
{}
Inorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse current node
Traverse the right subtree
Current Status:
Now algorithm is in node D.
Node D has not left node.
The algorithm traverse current node.
Node D has not right node.
Current node moves back to B
Traversed List:
{
D
}
Inorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse current node
Traverse the right subtree
Current Status:
Now algorithm is in node B.
Left child has allready visited.
The algorithm traverse current node.
Node B has right node.
Current node moves to E
Traversed List:
{D,
B
}
Inorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse current node
Traverse the right subtree
Current Status:
Now algorithm is in node E.
Node E has not left node.
The algorithm traverse current node.
Node E has not right node.
Current node moves back to B
Traversed List:
{D, B,
E
}
Inorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse current node
Traverse the right subtree
Current Status:
Now algorithm is in node B.
Left child has allready visited.
The algorithm has already traversed current node.
Right child has allready visited.
Current node moves back to A
Traversed List:
{D, B, E}
Inorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse current node
Traverse the right subtree
Current Status:
Now algorithm is in node A.
Left child has allready visited.
The algorithm traverse current node.
Node A has right node.
Current node moves to C
Traversed List:
{D, B, E,
A
}
Inorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse current node
Traverse the right subtree
Current Status:
Now algorithm is in node C.
Node C has left node.
The algorithm calls Left Child Node for Traversal.
Current node moves to F
Traversed List:
{D, B, E, A}
Inorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse current node
Traverse the right subtree
Current Status:
Now algorithm is in node F.
Node F has not left node.
The algorithm traverse current node.
Node F has not right node.
Current node moves back to C
Traversed List:
{D, B, E, A,
F
}
Inorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse current node
Traverse the right subtree
Current Status:
Now algorithm is in node C.
Left child has allready visited.
The algorithm traverse current node.
Node C has right node.
Current node moves to G
Traversed List:
{D, B, E, A, F,
C
}
Inorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse current node
Traverse the right subtree
Current Status:
Now algorithm is in node G.
Node E has not left node.
The algorithm traverse current node.
Node E has not right node.
Inorder Traverse Algorithm Completed..
Traversed List:
{D, B, E, A, F, C,
G
}
Preorder Traversal Algorithm
Algorithm Blueprint:
Traverse current node
Traverse the left subtree
Traverse the right subtree
Current Status:
Now algorithm is in node A.
The algorithm traverse current node.
Node A has left node.
The algorithm calls Left Child Node for Traversal.
Current node moves to B
Traversed List:
{
A
}
Preorder Traversal Algorithm
Algorithm Blueprint:
Traverse current node
Traverse the left subtree
Traverse the right subtree
Current Status:
Now algorithm is in node B.
The algorithm traverse current node.
Node B has left node.
The algorithm calls Left Child Node for Traversal.
Current node moves to D
Traversed List:
{A,
B
}
Preorder Traversal Algorithm
Algorithm Blueprint:
Traverse current node
Traverse the left subtree
Traverse the right subtree
Current Status:
Now algorithm is in node D.
The algorithm traverse current node.
Node D has no left node.
Node D has no right node.
Current node moves back to B
Traversed List:
{A, B,
D
}
Preorder Traversal Algorithm
Algorithm Blueprint:
Traverse current node
Traverse the left subtree
Traverse the right subtree
Current Status:
Now algorithm is in node B.
The algorithm has already traverse current node.
Left node has already traversed.
Node B has right node.
The algorithm calls Right Child Node for Traversal.
Current node moves to E
Traversed List:
{A, B, D}
Preorder Traversal Algorithm
Algorithm Blueprint:
Traverse current node
Traverse the left subtree
Traverse the right subtree
Current Status:
Now algorithm is in node E.
The algorithm traverse current node.
Node D has no left node.
Node D has no right node.
Current node moves back to B
Traversed List:
{A, B, D,
E
}
Preorder Traversal Algorithm
Algorithm Blueprint:
Traverse current node
Traverse the left subtree
Traverse the right subtree
Current Status:
Now algorithm is in node B.
The algorithm has already traverse current node.
Left node has already traversed.
Right node has already traversed.
Current node moves back to A
Traversed List:
{A, B, D, E}
Preorder Traversal Algorithm
Algorithm Blueprint:
Traverse current node
Traverse the left subtree
Traverse the right subtree
Current Status:
Now algorithm is in node A.
The algorithm has already traverse current node.
Left node has already traversed.
Node A has right node.
The algorithm calls Right Child Node for Traversal.
Current node moves to C
Traversed List:
{A, B, D, E}
Preorder Traversal Algorithm
Algorithm Blueprint:
Traverse current node
Traverse the left subtree
Traverse the right subtree
Current Status:
Now algorithm is in node C.
The algorithm traverse current node.
Node C has left node.
The algorithm calls Left Child Node for Traversal.
Current node moves to F
Traversed List:
{A, B, D, E,
C
}
Preorder Traversal Algorithm
Algorithm Blueprint:
Traverse current node
Traverse the left subtree
Traverse the right subtree
Current Status:
Now algorithm is in node F.
The algorithm traverse current node.
Node F has no left node.
Node F has no right node.
Current node moves back to C
Traversed List:
{A, B, D, E, C,
F
}
Preorder Traversal Algorithm
Algorithm Blueprint:
Traverse current node
Traverse the left subtree
Traverse the right subtree
Current Status:
Now algorithm is in node C.
The algorithm has already traverse current node.
Left node has already traversed.
Node C has right node.
The algorithm calls Right Child Node for Traversal.
Current node moves to G
Traversed List:
{A, B, D, E, C, F}
Preorder Traversal Algorithm
Algorithm Blueprint:
Traverse current node
Traverse the left subtree
Traverse the right subtree
Current Status:
Now algorithm is in node G.
The algorithm traverse current node.
Node G has no left node.
Node G has no right node.
Preorder Traverse Algorithm Completed..
Traversed List:
{A, B, D, E, C, F,
G
}
Postorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse the right subtree
Traverse current node
Current Status:
Now algorithm is in node A.
Node A has left node.
The algorithm calls Left Child Node for Traversal.
Current node moves to B
Traversed List:
{}
Postorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse the right subtree
Traverse current node
Current Status:
Now algorithm is in node B.
Node B has left node.
The algorithm calls Left Child Node for Traversal.
Current node moves to D
Traversed List:
{}
Postorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse the right subtree
Traverse current node
Current Status:
Now algorithm is in node D.
Node B has no left node.
Node B has no right node.
The algorithm traverse current node.
Current node moves back to B
Traversed List:
{
D
}
Postorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse the right subtree
Traverse current node
Current Status:
Now algorithm is in node B.
Left node has already be traveled.
Node B has right node.
The algorithm calls Right Child Node for Traversal.
Current node moves back to E
Traversed List:
{D}
Postorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse the right subtree
Traverse current node
Current Status:
Now algorithm is in node E.
Node E has no left node.
Node E has no right node.
The algorithm traverse current node.
Current node moves back to B
Traversed List:
{D,
E
}
Postorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse the right subtree
Traverse current node
Current Status:
Now algorithm is in node B.
Left node has already be traveled.
Right node has already be traveled.
The algorithm traverse current node.
Current node moves back to A
Traversed List:
{D, E,
B
}
Postorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse the right subtree
Traverse current node
Current Status:
Now algorithm is in node A.
Left node has already be traveled.
Node A has right node.
The algorithm calls Right Child Node for Traversal.
Current node moves to C
Traversed List:
{D, E, B}
Postorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse the right subtree
Traverse current node
Current Status:
Now algorithm is in node C.
Node C has left node.
The algorithm calls Left Child Node for Traversal.
Current node moves to F
Traversed List:
{D, E, B}
Postorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse the right subtree
Traverse current node
Current Status:
Now algorithm is in node F.
Node F has no left node.
Node F has no right node.
The algorithm traverse current node.
Current node moves back to C
Traversed List:
{D, E, B,
F
}
Postorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse the right subtree
Traverse current node
Current Status:
Now algorithm is in node C.
Left node has already be traveled.
Node C has right node.
The algorithm calls Right Child Node for Traversal.
Current node moves to G
Traversed List:
{D, E, B, F}
Postorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse the right subtree
Traverse current node
Current Status:
Now algorithm is in node G.
Node G has no left node.
Node G has no right node.
The algorithm traverse current node.
Current node moves back to C
Traversed List:
{D, E, B, F,
G
}
Postorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse the right subtree
Traverse current node
Current Status:
Now algorithm is in node C.
Left node has already be traveled.
Right node has already be traveled.
The algorithm traverse current node.
Current node moves back to A
Traversed List:
{D, E, B, F, G,
C
}
Postorder Traversal Algorithm
Algorithm Blueprint:
Traverse the left subtree
Traverse the right subtree
Traverse current node
Current Status:
Now algorithm is in node A.
Left node has already be traveled.
Right node has already be traveled.
The algorithm traverse current node.
Postorder Traverse Algorithm Completed..
Traversed List:
{D, E, B, F, G, C,
A
}
Progress Bar:
Algorithm Selection:
Inorder
Preorder
Postorder