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

Pre-order depth-first search (NLR, Preorder DFS)

 ... Discrete mathematics Graph (discrete mathematics) Type of graph Tree (data structure) Tree traversal Depth-first search
 0 By others on same topic  0 Discussions  Updated 2025-06-17  +Created 1970-01-01  See my version
This is the order in which you would want to transverse to read the chapters of a book.
Like breadth-first search, this also has the property of visiting parents before any children.
  • Table of contents
    • Iterative pre-order Pre-order depth-first search

Iterative pre-order

 0  0 
Pre-order depth-first search
This is the easiest one to do iteratively:
  • pop and visit
  • push right to stack
  • push left to stack

 Ancestors (9)

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

 Incoming links (1)

  • In-order depth-first search

 Synonyms (1)

  • cirosantilli/preorder-dfs

 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