TreeIterator mi = new TreeIterator(tree, TreeIterator.Order.POSTORDER);
TreeIterator ai = new TreeIterator(auxTree, TreeIterator.Order.POSTORDER);
TreeEntry m = mi.hasNext() ? mi.next() : null;
TreeEntry a = ai.hasNext() ? ai.next() : null;
int curIndexPos = indexCounter;
Entry i = indexCounter < indexMembers.length ? indexMembers[indexCounter++] : null;
while (m != null || a != null || i != null) {
int cmpma = compare(m, a);
int cmpmi = compare(m, i);
int cmpai = compare(a, i);
TreeEntry pm = cmpma <= 0 && cmpmi <= 0 ? m : null;
TreeEntry pa = cmpma >= 0 && cmpai <= 0 ? a : null;
Entry pi = cmpmi >= 0 && cmpai >= 0 ? i : null;
if (pi != null)
visitEntry(pm, pa, pi);
else
finishVisitTree(pm, pa, curIndexPos);