From 51f8cc347759213758584ef98f9d8707e77848e6 Mon Sep 17 00:00:00 2001 From: Ritesh Bansal <riteshobansal@gmail.com> Date: Tue, 19 Nov 2019 11:29:30 -0500 Subject: [PATCH] update Trie --- Trie.py | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/Trie.py b/Trie.py index bd0b659..118f4c5 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 -- GitLab