Lines Matching refs:parent
93 * left & right children & parent. These constitute binary search trees.
95 int lchild[N + 1], rchild[N + 257], parent[N + 1];
157 * children of node i. These nodes need not be initialized. Also, parent[i]
158 * is the parent of node i. These are initialized to NIL (= N), which stands
173 sp->parent[i] = NIL;
200 sp->parent[r] = p;
208 sp->parent[r] = p;
222 sp->parent[r] = sp->parent[p];
225 sp->parent[sp->lchild[p]] = r;
226 sp->parent[sp->rchild[p]] = r;
227 if (sp->rchild[sp->parent[p]] == p)
228 sp->rchild[sp->parent[p]] = r;
230 sp->lchild[sp->parent[p]] = r;
231 sp->parent[p] = NIL; /* remove p */
239 if (sp->parent[p] == NIL)
251 sp->rchild[sp->parent[q]] = sp->lchild[q];
252 sp->parent[sp->lchild[q]] = sp->parent[q];
254 sp->parent[sp->lchild[p]] = q;
257 sp->parent[sp->rchild[p]] = q;
259 sp->parent[q] = sp->parent[p];
260 if (sp->rchild[sp->parent[p]] == p)
261 sp->rchild[sp->parent[p]] = q;
263 sp->lchild[sp->parent[p]] = q;
264 sp->parent[p] = NIL;