I have a dictionary of "n" words, and there are answers "m" for the answer. I want to output the number of words in a dictionary that are editing distances of 1 or 2. I want to optimize the result set, given that n and m are approximately 3000.
Edit added from answer below:
I will try to say it differently.
Initially, there are “n” words defined as a set of vocabulary words. The following “m” words are given, which are the query words and for each query word, I need to find if the word exists in the dictionary (Edit Distance '0') or the total number of words in the dictionary that are at an editing distance of 1 or 2 of the dictionary words.
Hopefully now the question is transparent.
Well, this expires if the time complexity is (m * n) n. The naive use of the DP Edit Distance editing algorithm. Even the calculation of the diagonal elements 2k + 1 times, where k is the threshold here k = 3 in the above case.
user189580
source
share