Lines Matching refs:parent
105 * left & right children & parent. These constitute binary search trees.
107 int lchild[N + 1], rchild[N + 257], parent[N + 1];
176 * children of node i. These nodes need not be initialized. Also, parent[i]
177 * is the parent of node i. These are initialized to NIL (= N), which stands
192 sp->parent[i] = NIL;
219 sp->parent[r] = p;
227 sp->parent[r] = p;
241 sp->parent[r] = sp->parent[p];
244 sp->parent[sp->lchild[p]] = r;
245 sp->parent[sp->rchild[p]] = r;
246 if (sp->rchild[sp->parent[p]] == p)
247 sp->rchild[sp->parent[p]] = r;
249 sp->lchild[sp->parent[p]] = r;
250 sp->parent[p] = NIL; /* remove p */
258 if (sp->parent[p] == NIL)
270 sp->rchild[sp->parent[q]] = sp->lchild[q];
271 sp->parent[sp->lchild[q]] = sp->parent[q];
273 sp->parent[sp->lchild[p]] = q;
276 sp->parent[sp->rchild[p]] = q;
278 sp->parent[q] = sp->parent[p];
279 if (sp->rchild[sp->parent[p]] == p)
280 sp->rchild[sp->parent[p]] = q;
282 sp->lchild[sp->parent[p]] = q;
283 sp->parent[p] = NIL;