MCPcopy
hub / github.com/careercup/ctci / SuffixTree

Method SuffixTree

java/Chapter 18/Question18_8/SuffixTree.java:8–13  ·  view source on GitHub ↗
(String s)

Source from the content-addressed store, hash-verified

6 SuffixTreeNode root = new SuffixTreeNode();
7
8 public SuffixTree(String s) {
9 for (int i = 0; i < s.length(); i++) {
10 String suffix = s.substring(i);
11 root.insertString(suffix, i);
12 }
13 }
14
15 public ArrayList<Integer> search(String s) {
16 return root.search(s);

Callers

nothing calls this directly

Calls 2

insertStringMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected