void expandNodes(ProgressListener progressListener,int num_nodes,int ntax,Stack amalgs,NetNode netNodes,int[] ordering) throws CanceledException {
  NetNode x, y, z, u, v, a;
  x=netNodes.next;
  y=x.next;
  z=y.next;
  z.next=x;
  x.prev=z;
  while (!amalgs.empty()) {
    u=(NetNode)(amalgs.pop());
    v=u.nbr;
    x=u.ch1;
    y=u.ch2;
    z=v.ch2;
    if (v != u.next) {
      NetNode tmp=u;
      u=v;
      v=tmp;
      tmp=x;
      x=z;
      z=tmp;
    }
    x.prev=u.prev;
    x.prev.next=x;
    x.next=y;
    y.prev=x;
    y.next=z;
    z.prev=y;
    z.next=v.next;
    z.next.prev=z;
    if (progressListener != null)     progressListener.checkForCancel();
  }
  while (x.id != 1) {
    x=x.next;
  }
  a=x;
  int t=0;
  do {
    ordering[++t]=a.id;
    a=a.next;
  }
 while (a != x);
}

void expandNodes ( ProgressListener progressListener , int num_nodes , int ntax , Stack amalgs , NetNode netNodes , int [ ] ordering ) throws CanceledException { NetNode x , y , z , u , v , a ; x = netNodes . next ; y = x . next ; z = y . next ; z . next = x ; x . prev = z ; while ( ! amalgs . empty ( ) ) { u = ( NetNode ) ( amalgs . pop ( ) ) ; v = u . nbr ; x = u . ch1 ; y = u . ch2 ; z = v . ch2 ; if ( v != u . next ) { NetNode tmp = u ; u = v ; v = tmp ; tmp = x ; x = z ; z = tmp ; } x . prev = u . prev ; x . prev . next = x ; x . next = y ; y . prev = x ; y . next = z ; z . prev = y ; z . next = v . next ; z . next . prev = z ; if ( progressListener != null ) progressListener . checkForCancel ( ) ; } while ( x . id != 1 ) { x = x . next ; } a = x ; int t = 0 ; do { ordering [ ++ t ] = a . id ; a = a . next ; } while ( a != x ) ; }
expands the net nodes to obtain the ordering , quickly
