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

Method select

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

Returns the i th smallest suffix as a string. @param i the index @return the i smallest suffix as a string @throws java.lang.IllegalArgumentException unless 0 <= i < n

(int i)

Source from the content-addressed store, hash-verified

156 * @throws java.lang.IllegalArgumentException unless {@code 0 <= i < n}
157 */
158 public String select(int i) {
159 if (i < 0 || i >= suffixes.length) throw new IllegalArgumentException();
160 return suffixes[i].toString();
161 }
162
163 /**
164 * Returns the number of suffixes strictly less than the {@code query} string.

Callers 2

mainMethod · 0.95
mainMethod · 0.95

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected