Consider the permutations method from the textbook, which is intended to return all permutations of the word passed in as a parameter. If line #8 is changed to add

Consider the permutations method from the textbook, which is intended to return all permutations of the word passed in as a parameter. If line #8 is changed to add the removed character to the end of each permutation of the shorter word, which change best describes the returned list?
result.add(s + word.charAt(i)); // line #8 revised
A.It contains all permutations.
B.It is an incomplete list of permutations.
C.It contains strings that are not permutations.
D.It contains duplicates of some permutations.

CategoriesUncategorized

Leave a Reply

Your email address will not be published.