PRG/421 Week 5 Java 5.9 LAB: All permutations of names

$ 7

PRG/421 Week 5 Java 5.9 LAB: All permutations of names

Write a program that lists all ways people can line up for a photo (all permutations of a list of Strings). The program will read a list of one-word names (until -1), and use a recursive method to create and output all possible orderings of those names, one ordering per line.

When the input is:
Julia Lucas Mia -1

then the output is (must match the below ordering):
Julia Lucas Mia
Julia Mia Lucas
Lucas Julia Mia
Lucas Mia Julia
Mia Julia Lucas
Mia Lucas Julia

990 in stock

SKU: PRG421WK5LAB5P9 Category:

Description

PRG/421 Week 5 Java 5.9 LAB: All permutations of names

Write a program that lists all ways people can line up for a photo (all permutations of a list of Strings). The program will read a list of one-word names (until -1), and use a recursive method to create and output all possible orderings of those names, one ordering per line.

When the input is:
Julia Lucas Mia -1

then the output is (must match the below ordering):
Julia Lucas Mia
Julia Mia Lucas
Lucas Julia Mia
Lucas Mia Julia
Mia Julia Lucas
Mia Lucas Julia

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.