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:
Ani Aya Kai
then the output is:
All unique orderings:
Ani Aya Kai : Possibility
Ani Kai Aya : Possibility
Aya Ani Kai : Possibility
Aya Kai Ani : Possibility
Kai Ani Aya : Possibility
Kai Aya Ani : Possibility
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
