Question: Integer listSize is read from input, then listSize strings are read from input and stored in ArrayList passengersToPick. listPassengers ( ) counts and outputs all

Integer listSize is read from input, then listSize strings are read from input and stored in ArrayList passengersToPick. listPassengers() counts and outputs all possible orderings of names in remainPassengers. Complete the listPassengers() base case to increment the value of choicesFound and output the following:
each element of pickedPassengers followed by a space
": Possibility "
the value of choicesFound
End with a newline. Then, return the value of choicesFound for the base case.
Click here for example
Ex: If the input is:
3
Ani Aya Kai
then the output is:
All unique orderings:
Ani Aya Kai : Possibility 1
Ani Kai Aya : Possibility 2
Aya Ani Kai : Possibility 3
Aya Kai Ani : Possibility 4
Kai Ani Aya : Possibility 5
Kai Aya Ani : Possibility 6

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!