For this problem I have a set S with initially 0 strings.
There are three types of queries:
- Add a string to set S with id = queryId.
- Remove the string from set S with id = removeId.
- Read a string M and print all strings in set S that have M as substring.
Let N be the size of S.
How would I solve this efficiently? I hope to reach a complexity of O((length of search string) + N) for query 3 and O(length of string) for queries 1 and 2. Is this possible, with for example a suffix tree?
I would like to use this for a fast search engine for a (big) data set that is changing dynamically.