OurBigBook About$ Donate
 Sign in+ Sign up
by Ciro Santilli (@cirosantilli, 37)

Iterative in-order

 ... Graph (discrete mathematics) Type of graph Tree (data structure) Tree traversal Depth-first search In-order depth-first search
 0 By others on same topic  0 Discussions  Updated 2025-05-26  +Created 1970-01-01  See my version
This is a bit harder than iterative pre-order: now we have to check if there is a left or right element or not:
  • (START) push current
  • if there is left:
    • move left
  • else:
    • (ELSE) pop
    • visit
    • if there is right
      • move right
      • GOTO START
    • else:
      • GOTO ELSE
The control flow can be slightly simplified if we allow NULLs: www.geeksforgeeks.org/inorder-tree-traversal-without-recursion/

 Ancestors (10)

  1. In-order depth-first search
  2. Depth-first search
  3. Tree traversal
  4. Tree (data structure)
  5. Type of graph
  6. Graph (discrete mathematics)
  7. Discrete mathematics
  8. Area of mathematics
  9. Mathematics
  10.  Home

 View article source

 Discussion (0)

+ New discussion

There are no discussions about this article yet.

 Articles by others on the same topic (0)

There are currently no matching articles.
  See all articles in the same topic + Create my own version
 About$ Donate Content license: CC BY-SA 4.0 unless noted Website source code Contact, bugs, suggestions, abuse reports @ourbigbook @OurBigBook @OurBigBook