diff --git a/Trie.py b/Trie.py index bd0b65927806f46414b18ae4fc362aa0714e37c9..118f4c51b484ebd36af60ee671fbb3b1d29cb441 100644 --- a/Trie.py +++ b/Trie.py @@ -119,7 +119,6 @@ class Trie: return mat - # This function mainly calls ancestorMatrixRec() def ancestorMatrix(self): # Create an empty ancestor array @@ -129,22 +128,4 @@ class Trie: import numpy as np mat = np.zeros((len(self.matrixElements), len(self.matrixElements)),dtype=int) # Fill ancestor matrix and find - return self.ancestorMatrixRec(self.root, anc, mat) - -def main(): - keys = ['/spotlight/impact/2014-11-24-master/naturalists.html', '/'] - - # Trie object - t = Trie() - - # Construct trie - for key in keys: - t.insert(key) - - # Search for different keys - print("{} ---- {}".format("/spotlight/impact/2014-11-24-master/naturalists.html", [t.search("/spotlight/impact/2014-11-24-master/naturalists.html")])) - print("{} ---- {}".format("/", [t.search("/")])) - - -if __name__ == '__main__': - main() \ No newline at end of file + return self.ancestorMatrixRec(self.root, anc, mat) \ No newline at end of file