MCPcopy Index your code
hub / github.com/careercup/ctci / addAdjacent

Method addAdjacent

java/Chapter 4/Question4_2/Node.java:14–21  ·  view source on GitHub ↗
(Node x)

Source from the content-addressed store, hash-verified

12 }
13
14 public void addAdjacent(Node x) {
15 if (adjacentCount < 30) {
16 this.adjacent[adjacentCount] = x;
17 adjacentCount++;
18 } else {
19 System.out.print("No more adjacent can be added");
20 }
21 }
22 public Node[] getAdjacent() {
23 return adjacent;
24 }

Callers 1

createNewGraphMethod · 0.80

Calls 1

printMethod · 0.45

Tested by

no test coverage detected