Removing elements from a list that are elements in another list

Discussion in 'C++' started by Adam Hartshorne, Jan 26, 2006.

  1. Hi All,

    I was wondering if somebody could tell me if there is an efficient way
    to do the following. Say I have a list(or vector) A and a list B, I want
    to remove any elements in B, that are also elements in A.

    Adam
     
    Adam Hartshorne, Jan 26, 2006
    #1
    1. Advertising

  2. Adam Hartshorne wrote:
    > Hi All,
    > [...]


    Refrain from posting twice please. Patience is a virtue.
     
    Victor Bazarov, Jan 26, 2006
    #2
    1. Advertising

  3. Adam Hartshorne

    Nitin Motgi Guest

    Adam Hartshorne wrote:
    > Hi All,
    >
    > I was wondering if somebody could tell me if there is an efficient way
    > to do the following. Say I have a list(or vector) A and a list B, I want
    > to remove any elements in B, that are also elements in A.
    >
    > Adam


    Can you provide more information about the elements in the list or
    vector.Like the type information. Because efficient algorithm IMO would
    depend on the type of data in the vector/list. So if you could provide
    that data I could give it a try.

    Thank you,
    Nitin Motgi
     
    Nitin Motgi, Jan 27, 2006
    #3
    1. Advertising

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. Helge Richter

    Removing Elements from a Vector

    Helge Richter, Feb 27, 2004, in forum: Java
    Replies:
    5
    Views:
    6,416
    Andrew Hobbs
    Feb 28, 2004
  2. Replies:
    5
    Views:
    304
  3. Chris  Chiasson
    Replies:
    6
    Views:
    624
    Richard Tobin
    Nov 14, 2006
  4. Adam Hartshorne
    Replies:
    7
    Views:
    364
    Pete Becker
    Jan 27, 2006
  5. Debajit Adhikary
    Replies:
    17
    Views:
    692
    Debajit Adhikary
    Oct 18, 2007
Loading...

Share This Page