Skip to main content
`Ctrl`+`K`

# skbio.tree.TreeNode.preorder

TreeNode.preorder(include_self=True)

  Perform preorder iteration over tree.

  Parameters:
    include_self bool

      include the initial node if True

  Yields:
    TreeNode

      Traversed node.

  See also

  `traverse`
  `postorder`
  `pre_and_postorder`
  `levelorder`
  `tips`
  `non_tips`

  Examples

      >>> from skbio import TreeNode
      >>> tree = TreeNode.read(["((a,b)c);"])
      >>> for node in tree.preorder():
      ...     print(node.name)
      None
      c
      a
      b