T
Typpo
Hi,
I have an ArrayList of decimals, and I want to figure out which two are
the closest (least difference) from one another. I know I can loop
through the decimals, but this is very tedious and some people have told
me there are easier ways.
Here is an example -
ArrayList contains:
1.12
1.15
2.45
2.44
2.44 and 2.45 have the least difference between them. Is there any easy
way to do this?
Thanks.
I have an ArrayList of decimals, and I want to figure out which two are
the closest (least difference) from one another. I know I can loop
through the decimals, but this is very tedious and some people have told
me there are easier ways.
Here is an example -
ArrayList contains:
1.12
1.15
2.45
2.44
2.44 and 2.45 have the least difference between them. Is there any easy
way to do this?
Thanks.