T Tâm Tây New member Sep 16, 2021 #1 What is time complexity to check if a string(length S1) is a substring of another string(length S2) stored in a Directed Acyclic Word Graph, given S2 is greater than S1? A. O(S1) B. O(S2) C. O(S1+S2) D. O(1)
What is time complexity to check if a string(length S1) is a substring of another string(length S2) stored in a Directed Acyclic Word Graph, given S2 is greater than S1? A. O(S1) B. O(S2) C. O(S1+S2) D. O(1)
D Danh Trịnh New member Sep 16, 2021 #2 Answer: A Explanation: For each check of a word of length S1, we need to follow at most S1 edges. Upvote 0 Downvote