Problem Description:
Consider the problem of finding all the conjugation words for a given input word. How to resolve the issue only given words and dictionaries. What happens if there is some time and space to respond to pre-processing of any query.
Problem Resolution:
1, given the word has a unique identifier and length, then in the case of sequential traversal of the whole dictionary, we can first calculate the length of the input word, length, skip, equal length, calculate the word identification, and then compare the identity and the identification of a given word.
Solution:
Scenario 1: In the case of no preprocessing, the solution is as above: problem Resolution 1, if you can pre-processing, the author gives the scheme is: to calculate the whole dictionary word ( identification, Word s) pair, and sort by identity, perform a second search, find the pair, J found all the conjugation words. the identity pair here should be a one-to-many mapping relationship.
Code implementation Reference: The second chapter of programming Zhu Ji Nanxiong questionc: The problem of solving the modified words