In Java: How would you match together random person objects from an ArrayList to
ID: 3864939 • Letter: I
Question
In Java:
How would you match together random person objects from an ArrayList to make a random group of Pairs and add them to an ArrayList so that each Person has a match and the same person doesn't have the multiple have multiple matches? Example Rob can not be person1 in pair more than once and also can not be person2 in pair more than wants, but has to be both a person1 and person2 just not in the same pair.
Explanation / Answer
public static int[] indexOfMultiple(ArrayList list, T object) { ArrayList indices = new ArrayList(); for (int i = 0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.