This is what I have so far. I need to computes the size of the tree above at depth k.
public static int above(Node t, int k) {
if (t == null) { return 0; }
if (t.key > k)
return (above(t.left, k - 1) + above(t.right, k - 1) + 1);
else {
return above(t.left, k - 1) + above(t.right, k - 1);
}
}
EDIT: This code works and computes the size of the tree at depth k.
public static int at(Node t, int k) {
if(t == null) return 0;
if(k == 0) return 1;
return at(t.left, k - 1) + at(t.right, k - 1);
}