Re: Can anyone help me on C++ question. tq

From: Richard Harter (cri_at_tiac.net)
Date: 04/13/04


Date: Tue, 13 Apr 2004 19:43:31 GMT

On Tue, 13 Apr 2004 12:25:34 -0400, Will Twentyman
<wtwentyman@read.my.sig> wrote:

>tmnet wrote:
>
>> Dear all,
>> Below is the question :
>>
>> Array manipulations, Class, Exception handling, Generic class.
>>
>> - design, implement and test a set class in c++ that provides the
>> operations; set membership, set intersection, set union and set diferrence.
>> An array is to be used to represent a set within a class.
>>
>> hope you all can help. thank you.
>>
>
>I'll be nice and assume you don't understand what a set is, rather than
>wanting us to do your homework for you.
>
>A set is a list without repetition, an array is a list.
>Union merges sets, might be thought of as +.
>Intersection uses only common elements, might be thought of as *.
>Difference removes elements of the second set from the first, might be
>thought of as -.
>
>Examples:
>
>A = {1,2,3,4}
>B = {1,3,5,7}
>
>A+B = {1,2,3,4,5,7}
>A*B = {1,3}
>A-B = {2,4}

As a minor bit of pedantry on an otherwise excellent post, a set is
not, I repeat NOT, a list with or without repetition, even though one
can represent a set with a list.

Richard Harter, cri@tiac.net
http://home.tiac.net/~cri, http://www.varinoma.com
A university is what a college becomes when the faculty
loses interest in students. - John Ciardi



Relevant Pages

  • Re: Algorithm question
    ... We have condition A for a database and condition B for a database. ... think of is to search each element of one array in another array. ... finding all the common elements of two arrays? ... Start one pointer each at the ...
    (comp.programming)
  • Re: Algorithm question
    ... We have condition A for a database and condition B for a database. ... think of is to search each element of one array in another array. ... finding all the common elements of two arrays? ... Start one pointer each at the ...
    (comp.programming)
  • Re: Algorithm question
    ... think of is to search each element of one array in another array. ... finding all the common elements of two arrays? ... Now sort these copies using the original data as the sort key: ... Start one pointer each at the ...
    (comp.programming)
  • finding most common elements between thousands of multiple arrays.
    ... the elements are initially held in a array within an array. ... just trying to find the most common elements between all the arrays ... but with my algorithm that only takes about ... times and it seems silly to iterate through 2 million things just to ...
    (comp.lang.python)
  • Re: Can anyone help me on C++ question. tq
    ... > Array manipulations, Class, Exception handling, Generic class. ... set membership, set intersection, set union and set diferrence. ... Intersection uses only common elements, might be thought of as *. ...
    (comp.programming)