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

Method length

06Lab-WordNet/SAP.java:125–129  ·  view source on GitHub ↗
(int v, int w)

Source from the content-addressed store, hash-verified

123
124 // length of the shortest ancestral path between v and w; -1 if no such path
125 public int length(int v, int w) {
126 Helper helper = new Helper();
127 helper.findSAP(v, w);
128 return helper.length;
129 }
130
131 // a common ancestor of v and w that participates in a shortest ancestral path; -1 if no such path
132 public int ancestor(int v, int w) {

Callers 4

mainMethod · 0.95
distanceMethod · 0.45
dfsMethod · 0.45
scoreOfMethod · 0.45

Calls 2

findSAPMethod · 0.95
validateMethod · 0.95

Tested by

no test coverage detected