:right-sidebar: True TraverseType =================================================================== .. currentmodule:: gi.repository.GLib .. class:: TraverseType :no-contents-entry: Specifies the type of traversal performed by :func:`~gi.repository.GLib.Tree.traverse`, :func:`~gi.repository.GLib.Node.traverse` and :func:`~gi.repository.GLib.Node.find`. The different orders are illustrated here: - In order: A, B, C, D, E, F, G, H, I .. image:: https://docs.gtk.org/glib/Sorted_binary_tree_inorder.svg - Pre order: F, B, A, D, C, E, G, I, H .. image:: https://docs.gtk.org/glib/Sorted_binary_tree_preorder.svg - Post order: A, C, E, D, B, H, I, G, F .. image:: https://docs.gtk.org/glib/Sorted_binary_tree_postorder.svg - Level order: F, B, G, A, D, I, C, E, H .. image:: https://docs.gtk.org/glib/Sorted_binary_tree_breadth-first_traversal.svg Fields ------ .. rst-class:: interim-class .. class:: TraverseType :no-index: .. attribute:: IN_ORDER Vists a node's left child first, then the node itself, then its right child. This is the one to use if you want the output sorted according to the compare function. .. attribute:: LEVEL_ORDER Is not implemented for [balanced binary trees][glib-Balanced-Binary-Trees]. For [n-ary trees][glib-N-ary-Trees], it vists the root node first, then its children, then its grandchildren, and so on. Note that this is less efficient than the other orders. .. attribute:: POST_ORDER Visits the node's children, then the node itself. .. attribute:: PRE_ORDER Visits a node, then its children.