Re: remove redundency in list of pairs



Hi,

> I want to construct a list of pairs without dupliactes, not the key
> value pairs, I just want to ensure that the pair (not ordered) is not
> dupliacted in the list.
>
> for example
>
> method input: (3, 4), (5, 6), (4, 3), (6, 5)
>
> method output: (3, 4), (5, 6).


Define your own pair-class, including an equals-method (and hash-method). Then
declare a (Hash)Set.

Greetings, Leon.


.



Relevant Pages

  • remove redundency in list of pairs
    ... I want to construct a list of pairs without dupliactes, ... but is there any utility in the java language ... Bluedoze ... Prev by Date: ...
    (comp.lang.java.help)
  • adding unordered pairs without duplicates
    ... I want to construct a list of pairs without dupliactes, ... but is there any utility in the java language ... Bluedoze ... Prev by Date: ...
    (comp.lang.java.programmer)