Preorder traversal (source code)

= Preorder traversal

Visit a rooted tree's root before recursively visiting its child subtrees in their specified order. For a <binary tree>, the order is root, left subtree, right subtree. Unlike <inorder traversal>, this interpretation stores an internal node's label before either child's labels.