I prefer the logic in the iterator below, where setNext doesn't contain the curTreeNum++.  They're inconsistent in where the increment happens.