MCPcopy
hub / github.com/kevin-wayne/algs4 / index

Method index

src/main/java/edu/princeton/cs/algs4/SuffixArray.java:124–127  ·  view source on GitHub ↗

Returns the index into the original string of the i th smallest suffix. That is, text.substring(sa.index(i)) is the i th smallest suffix. @param i an integer between 0 and n -1 @return the index into the original string of the i th smallest suffix @throws java

(int i)

Source from the content-addressed store, hash-verified

122 * @throws java.lang.IllegalArgumentException unless {@code 0 <= i < n}
123 */
124 public int index(int i) {
125 if (i < 0 || i >= suffixes.length) throw new IllegalArgumentException();
126 return suffixes[i].index;
127 }
128
129
130 /**

Callers 5

lcsMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
lrsMethod · 0.95
mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected