Lines Matching defs:balance
58 char balance; /* Difference in depths of subtrees. */
188 link->balance = 0;
196 /* Back up the tree fixing the balance flags. */
197 while (depth && !links[depth]->balance)
200 --links[depth]->balance;
202 ++links[depth]->balance;
207 if (depth && ((dirs[depth] == L && --links[depth]->balance)
208 || (dirs[depth] == R && ++links[depth]->balance)))
210 switch (links[depth]->balance)
218 t->balance = r->balance = 0;
224 l->balance = t->balance != 1 ? 0 : -1;
225 r->balance = t->balance != (char) -1 ? 0 : 1;
226 t->balance = 0;
238 t->balance = l->balance = 0;
244 l->balance = t->balance != 1 ? 0 : -1;
245 r->balance = t->balance != (char) -1 ? 0 : 1;
246 t->balance = 0;