← Back to Blog

[Tree] Preorder, Inorder, Postorder traversal

computer-science > problem-solving

2026-03-122 min read

#computer-science #tree

reference

Tree traversal refers to the process of visiting or accessing each node of a tree exactly once in a specific order.

tree traversal techniques

There're many familiar algorithms that are frequently seen in problem solving.

DFS(Depth-First Search)

BFS(Breadth-First Search)

traversal-img

Inorder Traversal

Inorder traversal visits the node in the order: Left -> Root -> Right

Uses of Inorder Traversal

Preorder Traversal

Preorder traversal visits the node in the order: Root -> Left -> Right

Uses of Preorder Traversal

Postorder Traversal

Postorder traversal visits the node in the order: Left -> Right -> Root

Uses of Postorder Traversal