enum GLib::TraverseType

Overview

Specifies the type of traversal performed by g_tree_traverse(), g_node_traverse() and g_node_find(). The different orders are illustrated here:

Defined in:

lib/gi-crystal/src/auto/g_lib-2.0/g_lib.cr

Enum Members

InOrder = 0_u32

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.

PreOrder = 1_u32

visits a node, then its children.

PostOrder = 2_u32

visits the node's children, then the node itself.

LevelOrder = 3_u32

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.

Instance Method Summary

Class methods inherited from struct Enum

g_type : UInt64 g_type

Instance Method Detail

def in_order? #

[View source]
def level_order? #

[View source]
def post_order? #

[View source]
def pre_order? #

[View source]