Lines Matching refs:parent
31 struct heap_node* parent;
72 /* Swap parent with child. Child moves closer to the root, parent moves away. */
74 struct heap_node* parent,
79 t = *parent;
80 *parent = *child;
83 parent->parent = child;
85 child->left = parent;
88 child->right = parent;
92 sibling->parent = child;
94 if (parent->left != NULL)
95 parent->left->parent = parent;
96 if (parent->right != NULL)
97 parent->right->parent = parent;
99 if (child->parent == NULL)
101 else if (child->parent->left == parent)
102 child->parent->left = child;
104 child->parent->right = child;
110 struct heap_node** parent;
118 newnode->parent = NULL;
128 parent = child = &heap->min;
130 parent = child;
140 newnode->parent = *parent;
145 * It's a min heap so parent < child must be true.
147 while (newnode->parent != NULL && less_than(newnode, newnode->parent))
148 heap_node_swap(heap, newnode->parent, newnode);
205 child->parent = node->parent;
208 child->left->parent = child;
212 child->right->parent = child;
215 if (node->parent == NULL) {
217 } else if (node->parent->left == node) {
218 node->parent->left = child;
220 node->parent->right = child;
224 * It's a min heap so parent < child must be true. If the parent is bigger,
238 /* Walk up the subtree and check that each parent is less than the node
242 while (child->parent != NULL && less_than(child, child->parent))
243 heap_node_swap(heap, child->parent, child);