}
private void insert(TreeIndexGraph tree, TreeIndexNode nn, LeafNodeData leafNodeData) {
+ if (nn.children==null)
+ nn.children=new TreeIndexNode[2];
if (nn.children[0] == null) {
TreeIndexNode newNode = tree.createNode(leafNodeData);
tree.addNode(newNode);
public TreeIndexNode(LeafNodeData data) {
this.data = data;
- this.children = new TreeIndexNode[2];
}
public void advance() {
if (nn.data == null) { // nn is cell
- if (nn.children[0] != null) {
- recurseForce(nn.children[0]);
- }
-
- if (nn.children[1] != null) {
- recurseForce(nn.children[1]);
+ for(int i=0;i<nn.children.length;i++) {
+ recurseForce(nn.children[i]);
}
// } else { // nn is body