![]() ![]() STEP 6: str = swapstring(str, start, i).STEP 5: generatePermutation(str, start + 1, end).STEP 4: str = swapstring(str, start, i).GeneratePermutation(String str, int start, int end) STEP 5:CALL generatePermutation(str, 0, len).Hope I could help you with your question. STEP 4: PRINT "All the permutations of the string are:" To print them, just iterate over the array afterwards: var myString 'xyz' permutations permut (myString) for (permutation of permutations) print (permutation) //Use the output method of your choice.An example of permutations of something other than a string would be this: For just three colors, we can have six different permutations, or ordered combinations of those colors. ![]() However, it does not need to be an existing word, but can simply be a re-arrangement of the characters.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |