Lines Matching refs:parent
30 struct heap_node* parent;
71 /* Swap parent with child. Child moves closer to the root, parent moves away. */
73 struct heap_node* parent,
78 t = *parent;
79 *parent = *child;
82 parent->parent = child;
84 child->left = parent;
87 child->right = parent;
91 sibling->parent = child;
93 if (parent->left != NULL)
94 parent->left->parent = parent;
95 if (parent->right != NULL)
96 parent->right->parent = parent;
98 if (child->parent == NULL)
100 else if (child->parent->left == parent)
101 child->parent->left = child;
103 child->parent->right = child;
109 struct heap_node** parent;
117 newnode->parent = NULL;
127 parent = child = &heap->min;
129 parent = child;
139 newnode->parent = *parent;
144 * It's a min heap so parent < child must be true.
146 while (newnode->parent != NULL && less_than(newnode, newnode->parent))
147 heap_node_swap(heap, newnode->parent, newnode);
198 child->parent = node->parent;
201 child->left->parent = child;
205 child->right->parent = child;
208 if (node->parent == NULL) {
210 } else if (node->parent->left == node) {
211 node->parent->left = child;
213 node->parent->right = child;
217 * It's a min heap so parent < child must be true. If the parent is bigger,
231 /* Walk up the subtree and check that each parent is less than the node
235 while (child->parent != NULL && less_than(child, child->parent))
236 heap_node_swap(heap, child->parent, child);