Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] how to calculate a "xor"
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-12-06 (05:08)
From: Alan Post <apost@r...>
Subject: [Caml-list] Re: how to calculate a "xor"
In article <>, Damien wrote:
> Given two sets A and B, I want to calculate A\B _and_ B\A.  The sets
> are represented by lists.
> without using an order to sort the lists, is there something better
> than the following (O(n^2)) ?

If you have a decent hashing function, you can get expected linear
time by putting the elements into hash tables.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: