public static String toString(int v[],int w){
  StringBuilder sb=new StringBuilder("[ ");
  for (int k=0; k < v.length; k++) {
    sb.append(String.format("%" + w + "d ",v[k]));
  }
  sb.append("]");
  return sb.toString();
}

public static String toString ( int v [ ] , int w ) { StringBuilder sb = new StringBuilder ( "[ " ) ; for ( int k = 0 ; k < v . length ; k ++ ) { sb . append ( String . format ( "%" + w + "d " , v [ k ] ) ) ; } sb . append ( "]" ) ; return sb . toString ( ) ; }
tostring - return an int [ ] as a nice string .
