Lines Matching refs:parent
30 struct heap_node* parent; member
73 struct heap_node* parent, in heap_node_swap() argument
78 t = *parent; in heap_node_swap()
79 *parent = *child; in heap_node_swap()
82 parent->parent = child; in heap_node_swap()
84 child->left = parent; in heap_node_swap()
87 child->right = parent; in heap_node_swap()
91 sibling->parent = child; in heap_node_swap()
93 if (parent->left != NULL) in heap_node_swap()
94 parent->left->parent = parent; in heap_node_swap()
95 if (parent->right != NULL) in heap_node_swap()
96 parent->right->parent = parent; in heap_node_swap()
98 if (child->parent == NULL) in heap_node_swap()
100 else if (child->parent->left == parent) in heap_node_swap()
101 child->parent->left = child; in heap_node_swap()
103 child->parent->right = child; in heap_node_swap()
109 struct heap_node** parent; in HEAP_EXPORT() local
117 newnode->parent = NULL; in HEAP_EXPORT()
127 parent = child = &heap->min; in HEAP_EXPORT()
129 parent = child; in HEAP_EXPORT()
139 newnode->parent = *parent; in HEAP_EXPORT()
146 while (newnode->parent != NULL && less_than(newnode, newnode->parent)) in HEAP_EXPORT()
147 heap_node_swap(heap, newnode->parent, newnode); in HEAP_EXPORT()
198 child->parent = node->parent; in HEAP_EXPORT()
201 child->left->parent = child; in HEAP_EXPORT()
205 child->right->parent = child; in HEAP_EXPORT()
208 if (node->parent == NULL) { in HEAP_EXPORT()
210 } else if (node->parent->left == node) { in HEAP_EXPORT()
211 node->parent->left = child; in HEAP_EXPORT()
213 node->parent->right = child; in HEAP_EXPORT()
235 while (child->parent != NULL && less_than(child, child->parent)) in HEAP_EXPORT()
236 heap_node_swap(heap, child->parent, child); in HEAP_EXPORT()