Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org._7hills.schifhay14.apcs;
- /**
- * @author Hayden Schiff
- * @version March 3, 2014
- * @assign.ment APCS Ch. 8 Recursion problems
- * @descrip.tion Programming Project #8.9
- *
- * Generates the Nth line of a Pascal's Triangle
- */
- public class PascalsTriangle {
- public static void main(String[] args) {
- }
- public static int[] getTriangleRow(int row) {
- if (row==1) {
- int[] theRow = {1};
- return theRow;
- }
- if (row==2) {
- int[] theRow = {1, 1};
- return theRow;
- }
- if (row==3) {
- int[] theRow = {1, 2, 1};
- return theRow;
- }
- int[] rowAbove = getTriangleRow(row-1);
- int[] theRow = new int[row];
- for (int i = 0; i < theRow.length; i++) {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement