Question: Linguists are interested in studying the way in which words are constructed, with common prefixes and suffixes giving important clues to the meanings of words
Linguists are interested in studying the way in which words are constructed, with common prefixes and suffixes giving important clues to the meanings of words they are contained in. Thus, a useful tool for a linguist would be to be able to identify all the words in a given collection, W, of words, that have the same prefix, p, or suffix, s. Indeed, it is useful even to just know the number of such words in W. Describe how to build a data structure for W that can quickly answer, for any prefix, p, or suffix, s, the number of words in W that have the prefix p or suffix s. What is the performance of your method?
Step by Step Solution
3.28 Rating (163 Votes )
There are 3 Steps involved in it
One way to build a data structure for W would be to construct a trie which is a treelike data ... View full answer
Get step-by-step solutions from verified subject matter experts
