Write routine getallwords that takes as parameter a word


Question: Write routine getAllWords that takes as parameter a word and returns a Set containing all the substrings of the word. The substrings do not need to be real words, nor contiguous, but the letters in the substrings must retain the same order as in the word. For instance, if the word is cabb, words that set returned by getAllWords would be [ "", "b", "bb", "a", "ab", "abb", "c", "cb", "cbb", "ca", "cab", "cabb" ].

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Write routine getallwords that takes as parameter a word
Reference No:- TGS02457720

Now Priced at $15 (50% Discount)

Recommended (98%)

Rated (4.3/5)