How are you? 

int[] a; // [1] 

int b[]; // [2] 

What is this:

int[] c[];

By what we know c is an array (like in [2]). 

What does c have inside? 

Because of [1] we say c is an array of arrays (of ints). 

Semester project: watch the videos and learn to

  (a) search
  (b) insert
  (c) and delete in a BST

https://docs.oracle.com/javase/tutorial/java/data/numberformat.html

public class Magic {
  public static void main(String[] args) {
    int size = Integer.parseInt( args[0] ); 
    int[][] matrix; 
    matrix = new int[size][size]; 
    // System.out.println( matrix ); 
    Magic.show(matrix); 
    Magic.makeMagic(matrix); 
  }
  public static void makeMagic(int[][] m) {
    int size = m.length; 
    int i = size-1, j = size/2; 
    for (int k = 1; k <= size * size; k++) {
      m[i][j] = k; 
      Magic.show(m);
      if (m[(i+1)%size][(j+1)%size] == 0) {
        i = (i+1)%size; 
        j = (j+1)%size; 
      } else {
        i = i - 1;  
      }
    }
  }
  public static void show(int[][] m) {
    for (int i = 0; i < m.length; i++) {
      // System.out.println(m[i]);  
      for (int j = 0; j < m[i].length; j++) {
        System.out.printf("%3d ", m[i][j]); 
      }
      System.out.println();
    }
    System.out.println("---------------"); 
  }
}

Run it like this:

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> java Magic 5
  0   0   0   0   0 
  0   0   0   0   0 
  0   0   0   0   0 
  0   0   0   0   0 
  0   0   0   0   0 
---------------
  0   0   0   0   0 
  0   0   0   0   0 
  0   0   0   0   0 
  0   0   0   0   0 
  0   0   1   0   0 
---------------
  0   0   0   2   0 
  0   0   0   0   0 
  0   0   0   0   0 
  0   0   0   0   0 
  0   0   1   0   0 
---------------
  0   0   0   2   0 
  0   0   0   0   3 
  0   0   0   0   0 
  0   0   0   0   0 
  0   0   1   0   0 
---------------
  0   0   0   2   0 
  0   0   0   0   3 
  4   0   0   0   0 
  0   0   0   0   0 
  0   0   1   0   0 
---------------
  0   0   0   2   0 
  0   0   0   0   3 
  4   0   0   0   0 
  0   5   0   0   0 
  0   0   1   0   0 
---------------
  0   0   0   2   0 
  0   0   0   0   3 
  4   6   0   0   0 
  0   5   0   0   0 
  0   0   1   0   0 
---------------
  0   0   0   2   0 
  0   0   0   0   3 
  4   6   0   0   0 
  0   5   7   0   0 
  0   0   1   0   0 
---------------
  0   0   0   2   0 
  0   0   0   0   3 
  4   6   0   0   0 
  0   5   7   0   0 
  0   0   1   8   0 
---------------
  0   0   0   2   9 
  0   0   0   0   3 
  4   6   0   0   0 
  0   5   7   0   0 
  0   0   1   8   0 
---------------
  0   0   0   2   9 
 10   0   0   0   3 
  4   6   0   0   0 
  0   5   7   0   0 
  0   0   1   8   0 
---------------
 11   0   0   2   9 
 10   0   0   0   3 
  4   6   0   0   0 
  0   5   7   0   0 
  0   0   1   8   0 
---------------
 11   0   0   2   9 
 10  12   0   0   3 
  4   6   0   0   0 
  0   5   7   0   0 
  0   0   1   8   0 
---------------
 11   0   0   2   9 
 10  12   0   0   3 
  4   6  13   0   0 
  0   5   7   0   0 
  0   0   1   8   0 
---------------
 11   0   0   2   9 
 10  12   0   0   3 
  4   6  13   0   0 
  0   5   7  14   0 
  0   0   1   8   0 
---------------
 11   0   0   2   9 
 10  12   0   0   3 
  4   6  13   0   0 
  0   5   7  14   0 
  0   0   1   8  15 
---------------
 11   0   0   2   9 
 10  12   0   0   3 
  4   6  13   0   0 
  0   5   7  14  16 
  0   0   1   8  15 
---------------
 11   0   0   2   9 
 10  12   0   0   3 
  4   6  13   0   0 
  0   5   7  14  16 
 17   0   1   8  15 
---------------
 11  18   0   2   9 
 10  12   0   0   3 
  4   6  13   0   0 
  0   5   7  14  16 
 17   0   1   8  15 
---------------
 11  18   0   2   9 
 10  12  19   0   3 
  4   6  13   0   0 
  0   5   7  14  16 
 17   0   1   8  15 
---------------
 11  18   0   2   9 
 10  12  19   0   3 
  4   6  13  20   0 
  0   5   7  14  16 
 17   0   1   8  15 
---------------
 11  18   0   2   9 
 10  12  19  21   3 
  4   6  13  20   0 
  0   5   7  14  16 
 17   0   1   8  15 
---------------
 11  18   0   2   9 
 10  12  19  21   3 
  4   6  13  20  22 
  0   5   7  14  16 
 17   0   1   8  15 
---------------
 11  18   0   2   9 
 10  12  19  21   3 
  4   6  13  20  22 
 23   5   7  14  16 
 17   0   1   8  15 
---------------
 11  18   0   2   9 
 10  12  19  21   3 
  4   6  13  20  22 
 23   5   7  14  16 
 17  24   1   8  15 
---------------
 11  18  25   2   9 
 10  12  19  21   3 
  4   6  13  20  22 
 23   5   7  14  16 
 17  24   1   8  15 
---------------


Please write your name and then create a BST with these
numbers in (inserted in this order): 10, 5, 7, 13, 12, 11.

--

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);
  }
  public static long fibo(int n) {
    if (n == 0) return 0;
    else if (n == 1) return 1;
    else return One.fibo(n-1) + One.fibo(n-2);
  }


--

Welcome to DrJava.  Working directory is C:\Users\dgerman\Desktop
> java One 43
It took 2326 ms to calculate fibo(43) = 433494437
> java One 44
It took 3786 ms to calculate fibo(44) = 701408733
> java One 45
It took 6096 ms to calculate fibo(45) = 1134903170
> java One 46
It took 9999 ms to calculate fibo(46) = 1836311903
> java One 47
It took 16090 ms to calculate fibo(47) = 2971215073


So: 

  (a) use BigInteger objects 

  (b) either use loops or accumulator passing style 

--