Re: More on lists and sets

From: David Cressey <dcressey_at_verizon.net>
Date: Tue, 28 Mar 2006 13:04:36 GMT
Message-ID: <EvaWf.3093$Po1.725_at_trndny01>


"vc" <boston103_at_hotmail.com> wrote in message news:1143546405.035888.3990_at_u72g2000cwu.googlegroups.com...

> intersect is list intersection, e.g.,
>
> [1,2,3,4] `intersect` [2,4,6,8] == [2,4]
>

Looks like set intersection to me. And I'm going to ask: dontcha have to sort the two lists to find the common elements? And, if you do have to sort, what if the two lists each have 10,000 elements? Isn't that going to slow you down?

More importanlty, if you have to sort the elements (based on their value), haven't you basically ignored the fact that they were ordered to begin with?

Another way of asking the same question:

    [1,2,3,4] `intersect` [2,4,6,8] == [4,2]

Is this a "wrong" answer? Or is it a second "right" answer?

Another way of asking the same question:

Is a pizza with onions and mushrooms the same thing as a pizza with mushrooms and onions? Received on Tue Mar 28 2006 - 15:04:36 CEST

Original text of this message