-
트리 탐색 방법 (Tree traversal)공부/자료구조 2018. 9. 28. 13:56
Preorder
- Visit the root.
- Visit the left-subtree.
- Visit the right-subtree.
Inorder
- Visit the left-subtree.
- Visit the root.
- Visit the right-subtree.
Postorder
- Visit the right-subtree.
- Visit the left-subtree.
- Visit the root.
Breadth First Search(BFS) or Level order traversals
- starts at the tree root and explores the neighbor nodes first, before moving to the next level neighbors.
Depth First Search(DFS)
예시