Lab 10: Recursion 🔐

Due Date and Submission Requirements


The goal of this lab is:


Background Information

In computer science, generating permutations is a common task that involves arranging a set of items in every possible order. This technique can be especially relevant in password cracking, where the goal is to try every possible combination of characters until the correct password is found. This lab will focus on using recursion to generate all permutations of a given set of characters (like those in a password) to simulate this process.

For example, for the characters "abc", the permutations include:
In this lab, we will be attempting to crack the password of an individual who adores his two dogs, Max and Andy.
We are pretty sure that his password is some permutation of one of the two names, so we must generate all possible permutations of their names in order to gain access to his computer.

Directions

Using Lab10Demo.java as a starting point, you will fill in the body of the generate_permutations and the print_permutations_recursive method. You cannot modify anything in the main() method.

The generate_permutations method recursively generates all permutations. This method MUST use recursion.
generate_permutations takes the following parameters:
The print_permutations_recursive prints each permutation in the order it was generated. This method MUST use recursion.
print_permutations_recursive takes the following parameters:

Starting Code

Output

When you run your program, your output should look exactly like this: sample output.

Hints

Grading (10 points)