### Method

# Ide TreeNode insert_sorted

#### Declaration

    void
    ide_tree_node_insert_sorted (
      IdeTreeNode* self,
      IdeTreeNode* child,
      IdeTreeNodeCompare cmpfn
    )

#### Description

Insert `child` as a child of `self` at the sorted position determined by `cmpfn`

This operation is O(n).

Available since: | 3.32

#### Parameters

`child` | `IdeTreeNode`
| An `IdeTreeNode`.
| The data is owned by the caller of the function.
`cmpfn` | `IdeTreeNodeCompare`
| An `IdeTreeNodeCompare`.