Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #7576

Re: remove duplicates?

From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: remove duplicates?
Date 2011-09-05 11:07 -0700
Organization Canadian Mind Products
Message-ID <4s3a67plqnfbu7ih5e4fih222q7bgm7df5@4ax.com> (permalink)
References <c299b494-241e-481f-b993-a6272f15b915@j1g2000yqn.googlegroups.com>

Show all headers | View raw


On Mon, 5 Sep 2011 01:44:06 -0700 (PDT), bob <bob@coolgroups.com>
wrote, quoted or indirectly quoted someone who said :

>Let's say you have a Vector of String objects.  What is the easiest
>way to remove duplicates?

for just a few, scan backwards and do a delete. This will slide
objects down.

For many objects, copy just the objects you want to a new Vector
(ArrayList)
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
The modern conservative is engaged in one of man's oldest exercises in moral philosophy; that is, 
the search for a superior moral justification for selfishness.
~ John Kenneth Galbraith (born: 1908-10-15 died: 2006-04-29 at age: 97) 

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Find similar


Thread

remove duplicates? bob <bob@coolgroups.com> - 2011-09-05 01:44 -0700
  Re: remove duplicates? RedGrittyBrick <RedGrittyBrick@spamweary.invalid> - 2011-09-05 10:23 +0100
  Re: remove duplicates? Stanimir Stamenkov <s7an10@netscape.net> - 2011-09-05 12:36 +0300
  Re: remove duplicates? rossum <rossum48@coldmail.com> - 2011-09-05 12:46 +0100
  Re: remove duplicates? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-05 08:38 -0400
  Re: remove duplicates? Patricia Shanahan <pats@acm.org> - 2011-09-05 05:51 -0700
  Re: remove duplicates? Roedy Green <see_website@mindprod.com.invalid> - 2011-09-05 11:07 -0700

csiph-web