private final ArrayList<AwtreeNodeLeaf> to_array(){
  ArrayList<AwtreeNodeLeaf> result=new ArrayList<AwtreeNodeLeaf>(leaf_count);
  AwtreeNode curr_node=root_node;
  if (curr_node == null)   return result;
  for (; ; ) {
    while (curr_node instanceof AwtreeNodeFork) {
      curr_node=((AwtreeNodeFork)curr_node).first_child;
    }
    result.add((AwtreeNodeLeaf)curr_node);
    AwtreeNodeFork curr_parent=curr_node.parent;
    while (curr_parent != null && curr_parent.second_child == curr_node) {
      curr_node=curr_parent;
      curr_parent=curr_node.parent;
    }
    if (curr_parent == null)     break;
    curr_node=curr_parent.second_child;
  }
  return result;
}

private final ArrayList < AwtreeNodeLeaf > to_array ( ) { ArrayList < AwtreeNodeLeaf > result = new ArrayList < AwtreeNodeLeaf > ( leaf_count ) ; AwtreeNode curr_node = root_node ; if ( curr_node == null ) return result ; for ( ; ; ) { while ( curr_node instanceof AwtreeNodeFork ) { curr_node = ( ( AwtreeNodeFork ) curr_node ) . first_child ; } result . add ( ( AwtreeNodeLeaf ) curr_node ) ; AwtreeNodeFork curr_parent = curr_node . parent ; while ( curr_parent != null && curr_parent . second_child == curr_node ) { curr_node = curr_parent ; curr_parent = curr_node . parent ; } if ( curr_parent == null ) break ; curr_node = curr_parent . second_child ; } return result ; }
inserts the leaves of this tree into an array list
