short level = (short)(treeLevel[nodeNumber] + 1); int nextNode = nodeNumber; while (++nextNode < size) { if(treeLevel[nextNode] == level) ++count; if (next[nextNode] <= nodeNumber) break;
short level = (short)(treeLevel[nr] + 1); int nextNode = getFirstChildFor(nr); while (nextNode > nr) { ++count; nextNode = next[nextNode];
    public int getChildCountFor(int nodeNumber) {        int count = 0;        short level = (short)(treeLevel[nodeNumber] + 1);        int nextNode = nodeNumber;        while (++nextNode < size) {            if(treeLevel[nextNode] == level)                ++count;            if (next[nextNode] <= nodeNumber) break;        }        return count;    }