BST Traversals

Binary Search Tree Algorithms

How it Works: Traversals are algorithms used to visit every node in a tree exactly once. The order in which nodes are visited changes the resulting output drastically.

Instructions:

  • Build Tree: Add nodes manually or click "Random Tree".
  • Select Traversal: Choose Pre, In, Post, or Level-Order.
  • Control Flow: Use the Play, Pause, and Step buttons at the bottom to watch the recursive stack in action.

Traversal Types:

  • Pre-Order (NLR): Node, Left, Right.
  • In-Order (LNR): Left, Node, Right. (Outputs sorted data!)
  • Post-Order (LRN): Left, Right, Node.
  • Level-Order (BFS): Top to bottom, left to right.
Designed by NDAHI CO. LTD
1.0x