NODE *__fill(NODE *temp, int *a, int *n){ if(temp ==0) return; __fill(temp->left, a, n); a[(*n)++] = temp->data; __fill(temp->right, a, n); }
static GError* _fill(struct sqlx_sqlite3_s *sq3,guint replicas, gchar **m1urls) { struct sqlx_repctx_s *repctx = NULL; GError *err = NULL; guint max; max = m1urls ? g_strv_length(m1urls) : 0; EXTRA_ASSERT(max > 0 && max < 65536); err = sqlx_transaction_begin(sq3, &repctx); if (NULL != err) return err; while (replicas--) { err = __fill(sq3->db, m1urls, max, replicas); if (err) break; } return sqlx_transaction_end(repctx, err); }
void bal(NODE *temp){ int a[100]; int n = 0; __fill(temp, a, &n); root = __bal(a, n); }