You are on page 1of 1

level-order traversal

(algorithm)

Definition: Process all nodes of a tree by depth: first the root, then the children of the
root, etc. Equivalent to a breadth-first search from the root.

breadth-first search
(algorithm)

Definition: Any search algorithm that considers neighbors of a vertex, that is, outgoing
edges of the vertex's predecessor in the search, before any outgoing edges of the vertex.
Extremes are searched last. This is typically implemented with a queue.

depth-first search
(algorithm)

Definition: (1) Any search algorithm that considers outgoing edges (children) of a vertex
before any of the vertex's siblings, that is, outgoing edges of the vertex's predecessor in
the search. Extremes are searched first. This is easily implemented with recursion. (2) An
algorithm that marks all vertices in a directed graph in the order they are discovered and
finished, partitioning the graph into a forest.

Also known as DFS.

Specialization (... is a kind of me.)


preorder traversal, in-order traversal, postorder traversal.

See also breadth-first search, best-first search, Schorr-Waite graph marking algorithm.

Note: Depth-first search doesn't specify if a vertex is considered before, during, or after
its outgoing edges or children. Thus it can be preorder, in-order, or postorder traversal.

You might also like