How are you. 

public class One {
  public static void main(String[] args) {
    System.out.println( fun(Integer.parseInt(args[0])) ); // 1 1 2 3 5 8 13 21 34 55 89 
                                   // 0 1 2 3 4 5  6  7  8  9 10 
  }
  public static int fun(int index) {
    if (index == 0) return 1; 
    else if (index == 1) return 1; 
    else return fun(index-1) + fun(index-2); 
  }
}

--

public class One {
  public static void main(String[] args) {
    long startTime = System.currentTimeMillis();
    int n = Integer.parseInt(args[0]); 
    long f = One.fibo(n);  
    long endTime = System.currentTimeMillis(); 
    System.out.println("It took " + (endTime - startTime) + 
                       " ms to calculate fibo(" + n + ") = " + f); 
  }
  // define your fibo method here
}

--

public class One {
  public static void main(String[] args) {
    long startTime = System.currentTimeMillis();
    int n = Integer.parseInt(args[0]);
    System.out.println( fun(n) ); // 1 1 2 3 5 8 13 21 34 55 89 
                                   // 0 1 2 3 4 5  6  7  8  9 10 
    long endTime = System.currentTimeMillis();
    int f = One.fun(n);
    System.out.println("It took " + (endTime - startTime) +
                       " ms to calculate fibo(" + n + ") = " + f);

  }
  public static int fun(int index) {
    if (index == 0) return 1; 
    else if (index == 1) return 1; 
    else return fun(index-1) + fun(index-2); 
  }
}

--

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> run One
java.lang.ArrayIndexOutOfBoundsException: 0
    at One.main(One.java:4)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at edu.rice.cs.drjava.model.compiler.JavacCompiler.runCommand(JavacCompiler.java:272)
> run One 10
89
It took 0 ms to calculate fibo(10) = 89
> run One 20
10946
It took 63 ms to calculate fibo(20) = 10946
> run One 30
1346269
It took 0 ms to calculate fibo(30) = 1346269
> run One 30
1346269
It took 0 ms to calculate fibo(30) = 1346269
> run One 40
165580141
It took 422 ms to calculate fibo(40) = 165580141
> run One 41
267914296
It took 671 ms to calculate fibo(41) = 267914296
> run One 42
433494437
It took 1078 ms to calculate fibo(42) = 433494437
> run One 43
701408733
It took 1734 ms to calculate fibo(43) = 701408733
> run One 44
1134903170
It took 2812 ms to calculate fibo(44) = 1134903170
> run One 45
1836311903
It took 4656 ms to calculate fibo(45) = 1836311903


--

Welcome to DrJava.  Working directory is C:\Users\dgerman\h212\spr2019\hw02
> java One 30
It took 1179358 ns to calculate fibo(30) = 832040
> java One 31
It took 18924 ns to calculate fibo(31) = 1346269
> java One 32
It took 30149 ns to calculate fibo(32) = 2178309
> java One 33
It took 19886 ns to calculate fibo(33) = 3524578
> java One 40
It took 61582 ns to calculate fibo(40) = 102334155
> java One 41
It took 25018 ns to calculate fibo(41) = 165580141
> java One 42
It took 24376 ns to calculate fibo(42) = 267914296
> java One 43
It took 32715 ns to calculate fibo(43) = 433494437
> java One 44
It took 26301 ns to calculate fibo(44) = 701408733
> java One 45
It took 24055 ns to calculate fibo(45) = 1134903170
> java One 46
It took 33998 ns to calculate fibo(46) = 1836311903
> java One 100
It took 94297 ns to calculate fibo(100) = 354224848179261915075
> java One 200
It took 123164 ns to calculate fibo(200) = 280571172992510140037611932413038677189525
> java One 300
It took 242479 ns to calculate fibo(300) = 222232244629420445529739893461909967206666939096499764990979600


--


public class One {
  public static void main(String[] args) {
    long startTime = System.nanoTime();
    int n = Integer.parseInt(args[0]);
    System.out.println( fun(n) ); // 1 1 2 3 5 8 13 21 34 55 89 
                                   // 0 1 2 3 4 5  6  7  8  9 10 
    long endTime = System.nanoTime();
    int f = One.fun(n);
    System.out.println("It took " + (endTime - startTime) +
                       " nanoseconds to calculate fibo(" + n + ") = " + f);

  }
  public static int fun(int index) {
    if (index == 0) return 1; 
    else if (index == 1) return 1; 
    else return fun(index-1) + fun(index-2); 
  }
}

--

public class BST {
  int value; 
  BST left, right; 
  public BST(int v, BST l, BST r) {
   this.value = v; 
   this.left = l;
   this.right = r; 
  }
  public String print() {
    return "(" + this.value + " " + 
                 ((this.left == null) ? "." : this.left.print()) + " " + 
                 ((this.right == null) ? "." : this.right.print())  + ")";  
  }
  public String toString() {
    return this.left + " " + this.value + " " + this.right;  
  }
  public static int size(BST node) {
    if (node == null) return 0; 
    else return 1 + BST.size(node.left) + BST.size(node.right); 
  }
  public int find(int k) { // k is 1 based find(3) produces element index 2 
    // System.out.println("Looking at: " + this.value + " seeking " + k); 
    if (k == 1 + BST.size(this.left)) return this.value; 
    else if ( k <= BST.size(this.left)) {
      return this.left.find(k); 
    } else {
      return this.right.find( k - 1 - BST.size(this.left)); 
    }
  }
  public boolean insert(int v) {
    if (this.value == v) { 
      return false;  
    } else {
      if (v < this.value) { 
        if (this.left == null) {
          this.left = new BST(v, null, null);
          return true; 
        } else {
          return this.left.insert(v); 
        }
      } else {
        if (this.right == null) {
          this.right = new BST(v, null, null);
          return true; 
        } else {
          return this.right.insert(v); 
        } 
      }
    }
  }
  public static void main(String[] args) {
    int n = (int)(Math.random() * 100 + 1); 
    System.out.println( n ); 
    BST a = new BST(n, null, null); 
    for (int i = 0; i < 6; i++) {
      n = (int)(Math.random() * 100 + 1); 
      System.out.println( n ); 
      a.insert(n); 
    }
    System.out.println( a.print() ); 
    
    
  }  
}

--

  public static void main(String[] args) {
    int size = 8000; // size of the tree in nodes 
    int range = 70000;
    int n = (int)(Math.random() * range + 1); 
    System.out.println( n ); 
    BST a = new BST(n, null, null); 
    for (int i = 0; i < size-1; i++) {
      n = (int)(Math.random() * range + 1); 
      // System.out.println( n ); 
      a.insert(n); 
    }
    System.out.println("-------------"); 
    int s = BST.size(a); 
    for (int i = 0; i < s; i++) {
      int k = a.find(i+1); 
      // System.out.println( k ); 
    }
    // System.out.println( a.print() ); 
    System.out.println(BST.size(a)); 
    
  }  

--

public class BST {
  int value; 
  BST left, right; 
  public BST(int v, BST l, BST r) {
   this.value = v; 
   this.left = l;
   this.right = r; 
  }
  public String print() {
    return "(" + this.value + " " + 
                 ((this.left == null) ? "." : this.left.print()) + " " + 
                 ((this.right == null) ? "." : this.right.print())  + ")";  
  }
  public String toString() {
    return this.left + " " + this.value + " " + this.right;  
  }
  public static int size(BST node) {
    if (node == null) return 0; 
    else return 1 + BST.size(node.left) + BST.size(node.right); 
  }
  public int find(int k) { // k is 1 based find(3) produces element index 2 
    // System.out.println("Looking at: " + this.value + " seeking " + k); 
    if (k == 1 + BST.size(this.left)) return this.value; 
    else if ( k <= BST.size(this.left)) {
      return this.left.find(k); 
    } else {
      return this.right.find( k - 1 - BST.size(this.left)); 
    }
  }
  public boolean insert(int v) {
    if (this.value == v) { 
      return false;  
    } else {
      if (v < this.value) { 
        if (this.left == null) {
          this.left = new BST(v, null, null);
          return true; 
        } else {
          return this.left.insert(v); 
        }
      } else {
        if (this.right == null) {
          this.right = new BST(v, null, null);
          return true; 
        } else {
          return this.right.insert(v); 
        } 
      }
    }
  }
  public static void main(String[] args) {
    int size = 8000; // size of the tree in nodes 
    int range = 16000;
    int n = (int)(Math.random() * range + 1); 
    System.out.println( n ); 
    BST a = new BST(n, null, null); 
    for (int i = 0; i < size-1; i++) {
      n = (int)(Math.random() * range + 1); 
      // System.out.println( n ); 
      a.insert(n); 
    }
    System.out.println("-------------"); 
    int s = BST.size(a); 
    long startTime = System.currentTimeMillis();
    for (int i = 0; i < s; i++) {
      int k = a.find(i+1); 
      // System.out.println( k ); 
    }
    long endTime = System.currentTimeMillis();
    // System.out.println( a.print() ); 
    System.out.println(BST.size(a) + " (" + (endTime - startTime) + ")" ); 
    
  }  
}

--

Need to determine how to change the size of the ...