Pascal's triangle: Difference between revisions

→‎Summing from Previous Rows: now it will work for rows = 0
(→‎Summing from Previous Rows: now it will work for rows = 0)
Line 336:
===Summing from Previous Rows===
{{works with|Java|1.5+}}
This implementation prints nothing for <tt>n = 0</tt>.
<java>import java.util.LinkedList;
...//class definition, etc.
public static void genPyrN(int rows){
if(rows <= 0) return;
//save the last row here
LinkedList<Integer> last= new LinkedList<Integer>();
Anonymous user