Originally Posted by
Zosden
Heres a nice template for recursion
public <modifier> recusiveAlg(You need some sort of parameter)
{
if(some sort of stopping criteria)
{
return something;
}
else
{
return recursiveAlg(your parameter - 1)
}
}
Try to do this with Fibonacci numbers
hint: Fibonacci's numbers are the previous fib number + the one before the pervious fib number.
hmmm correct me if i'm wrong but isn't it already implemented in the main function?
if (n > 0) {
int[][] pascal = Rows(n);
for (int[] row : pascal) {
for (int v : row) System.out.print(v + " ");
System.out.println("");
all Rows has to do is to generate the array somehow to decide the row number...