MCPcopy Create free account
hub / github.com/MolinDeng/Princeton-algs4 / validate

Method validate

01Lab-Percolation/Percolation.java:39–42  ·  view source on GitHub ↗
(int p, String desc)

Source from the content-addressed store, hash-verified

37 }
38
39 private void validate(int p, String desc) {
40 if (p < 1 || p > gridSize)
41 throw new IllegalArgumentException(desc + " index i out of bounds");
42 }
43
44 private boolean isInGrid(int row, int col) {
45 return row >= 1 && row <= gridSize && col >= 1 && col <= gridSize;

Callers 3

openMethod · 0.95
isOpenMethod · 0.95
isFullMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected