topicalgorithms

Binary Tree DFS Traversal

Binary Tree Traversal - Depth First Search DFS

Problem

Given a Binary Search Tree, Do the Depth First Search/Traversal .

Solution

In a Binary Tree, we can do 3 kinds of DFS:

  • Inorder Traversal (Left-Root-Right) - [Binary Tree Inorder Traversal](/cs/problems/binary-tree-inorder-traversal)
  • Preorder Traversal (Root-Left-Right) - [Binary Tree Preorder Traversal](/cs/problems/binary-tree-preorder-traversal)
    • [Morris Traversal - Inorder Tree Traversal without recursion and without stack but using constant space](/cs/problems/morris-traversal)
  • Postorder Traversal (Left-Right-Root) - [Binary Tree Postorder Traversal](/cs/problems/binary-tree-postorder-traversal)