public class ModularPascalsTriangle
extends java.lang.Object
Constructor and Description |
---|
ModularPascalsTriangle(int rows,
int cols,
int mod)
Generate Pascal's Triangle using modular arithmetic given rows and columns of data and modulus.
|
Modifier and Type | Method and Description |
---|---|
int |
getCols()
Return the number of columns of computed modular Pascal's triangle data.
|
int |
getMod()
Return the modulus value used to compute the modular Pascal's triangle data.
|
int |
getRows()
Return the number of rows of computed modular Pascal's triangle data.
|
int |
getValue(int row,
int col)
Get the modular Pascal's triangle data at the given row and column.
|
public ModularPascalsTriangle(int rows, int cols, int mod)
rows
- - number of rowscols
- - number of columnsmod
- - given modulus for arithmeticpublic int getValue(int row, int col)
row
- - given row indexcol
- - given column indexpublic int getRows()
public int getCols()
public int getMod()