Thursday, April 26, 2007

Dr Jacobson's hints on Pascal

Dr Jacobson wrote an email to the class with the following hints. If you have no idea how to approach Part B of hw2, this hint may come in handy.
I used two arrays:

int[] thisRow = new int[50];
int[] nextRow = new int[50];

I initialized the first row to be 1,0,0,...0
I printed out theRow.
I then used the formulas to figure out the nextRow.
I copied nextRow back to thisRow.
I printed out thisRow.
And so on...

No comments: