/** An instance maintains an integer, which can be any size */

/** This is a skeleton. Implement and test the methods in the order in which they
    appear in the class.
    
    When writing the methods where you divide by 10 and get the
    remainder when dividin by 10, use constant BASE instead of 10.
    If you do that properly, you will be able to change the class to use
    and basae, for example base 2^15-1, or 32767. */
public class BigInt {
    
    public static final int BASE= 10;
    
    private int sign; // -1 or +1, depending on whether this integer is negative or non-negative.
    
    private int[] numb; // the array of digits in this integer, with least significant digit first.
                        // e.g. the integer 3124 would be stored as {4, 2, 3, 1}
                        // numb.length = number of digits needed to store the integer (0 for integer 0)
    
   /** = number of digits for n, with no leading 0Õs. */
    public static int length(int n) {
        return 0;
    }
 
    /** Constructor: an instance for n. */
    public BigInt(int n) {

    }

    /** = this integer as a string */
    public String toString() {
        return null;
    }
   
    
    /** Constructor: an instance with value 0 */
    public BigInt() {
        
    }
    
    /** = 1, 0, or -1 depending on whether the absolute value of
          this BigInt is >, =, or < b */
    private int compareAbs(BigInt b) {
        
        return 0;
    }
    
    /** = 1, 0, or -1 depending on whether this
          BigInt is greater, equal, or less than b. */
    public int compareTo(BigInt b) {
        return 0;
    }
    
    /** = "b is a BigInt and contains the same integer as this one", */
    public boolean equals(Object b) {
        return false;
    }
    

    /** = the sum of x and y.
          Precondition: x and y are non-negative. */
    public static BigInt add(BigInt x, BigInt y) {
        BigInt z= new BigInt();
        return z;
    }
    
    /** = Ð x. */
    public static BigInt negate(BigInt x) {
        // Remember to copy the sign and array numb into a new BigInt
        // variable; don't just do sign= - sign, because parameter x
        // should not be changed.
        return null;
    }

    
    /** = index of minimum of b[h..k].
          Precondition: h <= k.*/
    public static int min(BigInt[] b, int h, int k) {
        return 0;
    }
    
    /** Sort array b, using selection sort */
    public static void sort(BigInt[] b) {
        
    }
    
    
    public static int test(int n) {
        int num;
        if (n < 0) n= -n;
        
        if (n < 10)
            num= num + 1;
        
        return n/10 + test(n%10);
    }
    
}