I have a problem that I can't solve. I hope I can make you understand it.
Given the following list of Waypoint objects
List<Waypoint>myWaypoint = new ArrayList<Waypoint>();
I want to calculate the combinations no repetition of groups of 3 (k=3) of the elements in the list and and create a matrix containing only k-group combinations
Example:
List<Waypoint>myWaypoint = new ArrayList<Waypoint>();
Waypoint a = new Waypoint();
Waypoint b = new Waypoint();
Waypoint c = new Waypoint();
Waypoint d = new Waypoint();
myWaypoint.add(a);
myWaypoint.add(b);
myWaypoint.add(c);
myWaypoint.add(d);
n!/(r!(n-r)!)
k = 3 n = 4 -> combination: 4
New array of Waypoint object
The goal is to generate an array containing these objects