Sets - Bit Array Vs. List

Discussion in 'C++' started by Mike Wahler, Jul 31, 2003.

  1. Mike Wahler

    Mike Wahler Guest

    Sonoman <> wrote in message
    news:2OFWa.22896$2.webusenet.com...
    > Hello All:
    > What is the difference between these two.


    The standard library features a container type
    called 'std::list'. The same is not true of
    'bit array' (perhaps you meant something else?)

    >Is there any site that can show me
    > the contrast and similarities between both of these?


    The standard library has a 'list' type, but not a
    'bit array' type. Do you mean the 'std::bitset'
    type?

    If so, look in any programming or algorithms book
    which should show you the difference between an
    array and a linked list.

    >I have a couple of
    > begginer books that make no reference on this issue.


    Which books?

    >Please help.


    Peer reviews of C++ books can be viewed at
    www.accu.org

    -Mike
     
    Mike Wahler, Jul 31, 2003
    #1
    1. Advertisements

  2. Mike Wahler

    Sonoman Guest

    Hello All:
    What is the difference between these two. Is there any site that can show me
    the contrast and similarities between both of these? I have a couple of
    begginer books that make no reference on this issue. Please help. Thanks in
    advance.

    Sonoman
     
    Sonoman, Aug 2, 2003
    #2
    1. Advertisements

  3. "Sonoman" <> wrote in message
    news:2OFWa.22896$2.webusenet.com...
    > Hello All:
    > What is the difference between these two. Is there any site that can show

    me
    > the contrast and similarities between both of these? I have a couple of
    > begginer books that make no reference on this issue. Please help. Thanks

    in
    > advance.
    >
    > Sonoman
    >


    You asking about the implementation of sets using either arrays of bits or
    lists? Not really a C++ question.

    The obvious difference it that you can only implement sets whose members are
    chosen from a finite range of integral values using a bit array. You
    couldn't have a set of words implemented as a bit array for instance, but a
    list of strings would be possible. There are also efficiency differences
    between the two.

    Of course the C++ answer is to use neither, use std::set instead, (or even
    std::bitset) that's what its for.

    john
     
    John Harrison, Aug 2, 2003
    #3
  4. Mike Wahler

    Sonoman Guest

    C++ how to program by Deitel & Deitel, C++ in 21 days 2nd edition by Jesse
    Liberty, but these two do not have much that I can use. BUT I just borrowed
    from a friend The C++ programming Language by Stroustroup. I glanced at it
    and it looks very promising. I just hope it does not go over my head! It
    looks at lot more advanced that the other two.

    Sonoman


    "Mike Wahler" <> wrote in message
    news:bgff4d$6mt$...
    >
    > Sonoman <> wrote in message
    > news:2OFWa.22896$2.webusenet.com...
    > > Hello All:
    > > What is the difference between these two.

    >
    > The standard library features a container type
    > called 'std::list'. The same is not true of
    > 'bit array' (perhaps you meant something else?)
    >
    > >Is there any site that can show me
    > > the contrast and similarities between both of these?

    >
    > The standard library has a 'list' type, but not a
    > 'bit array' type. Do you mean the 'std::bitset'
    > type?
    >
    > If so, look in any programming or algorithms book
    > which should show you the difference between an
    > array and a linked list.
    >
    > >I have a couple of
    > > begginer books that make no reference on this issue.

    >
    > Which books?
    >
    > >Please help.

    >
    > Peer reviews of C++ books can be viewed at
    > www.accu.org
    >
    > -Mike
    >
    >
    >
     
    Sonoman, Aug 2, 2003
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Todd Gardner

    hex array to array of 16 bit numbers?

    Todd Gardner, Dec 25, 2003, in forum: Python
    Replies:
    4
    Views:
    472
    Francis Avila
    Dec 27, 2003
  2. Replies:
    3
    Views:
    2,219
    Timothy Bendfelt
    Jan 19, 2007
  3. Replies:
    9
    Views:
    1,362
    Juha Nieminen
    Aug 22, 2007
  4. akineko
    Replies:
    7
    Views:
    1,879
    akineko
    Dec 22, 2008
  5. Wanderer
    Replies:
    1
    Views:
    764
    Wanderer
    Mar 24, 2011
  6. deathweaselx86
    Replies:
    5
    Views:
    1,544
    Raymond Hettinger
    Jun 25, 2011
  7. gga
    Replies:
    6
    Views:
    273
    Stefan Lang
    Feb 17, 2005
  8. Jeff.M
    Replies:
    6
    Views:
    381
    Lasse Reichstein Nielsen
    May 4, 2009
Loading...