Pascal's triangle: Difference between revisions

Line 1,072:
thisRow.add(last.get(j - 1) + last.get(j));
}
thisRow.add(last.get(i0)); //end
last= thisRow;//save this row
System.out.println(thisRow);
}
}</lang>
 
===Combinations===
This method is limited to 21 rows because of the limits of <tt>long</tt>. Calling <tt>pas</tt> with an argument of 22 or above will cause intermediate math to wrap around and give false answers.
Anonymous user