Solution Review: Permutations of a String
This lesson provides a detailed review of the solution to the challenge of the previous lesson.
We'll cover the following...
We'll cover the following...
Solution: Permutations of a String
Understanding the Code
Every recursive code has two methods; the recursive method and the main method.
Driver Method
The recursive method is called within the driver method. Let’s first look at what it does-from lines 25 to 27.
-
An array of characters
inputis initialized on line 25. -
The recursive method
permutationsis called on line 26 which takes in two input parameters: ...