You might try using sets. Take a look at Set and HashSet, and in particular
look at the removeAll() and retainAll() methods. I believe this will do what
you want.
--
Martin Cooper
Tumbleweed Communications
----- Original Message -----
From: "Nimmons, Buster" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 30, 2001 6:08 AM
Subject: Most efficient way to compare two arrays
> I have two arrays each having around 3000 elements. One array is a list of
> file names from a database and the other is a list of files on a file
> server. I would like to compare the two arrays and end up with two arrays
> showing what was in each array that was not in the other array. I am
looking
> for the most efficient way to do this since these arrays could grow to be
> anywhere from 20,000 to 50,000 in size in the future.
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets