Greetings,
I am trying to find all pairs of X,Y axis Points in Java from each point to every other point as seen below. I am using Eclipse on Windows. Much appreciate for the help on this problem.
Three point example: (1.0, 2.0) (2.0, 2.0) (3.0, 4.0)
All pairs from each to every other point:
Output:
(1.0 ,2.0) (2.0, 2.0)
(1.0, 2.0) (3.0, 4.0)
(2.0, 2.0) (1.0, 2.0)
(2.0, 2.0) (3.0, 4.0)
(3.0, 4.0) (1.0, 2.0)
(3.0, 4.0) (2.0, 2.0)
Thanks,
Paul
Just iterate over the list two times and exclude the ones that are same: