Results 1 to 6 of 6
- 02-17-2009, 09:51 PM #1
Member
- Join Date
- Feb 2009
- Posts
- 3
- Rep Power
- 0
Compare two lists of number - what numbers arent there
Hi there. I am very new to Java. I would like to make a proggie that takes two lists of numbers, compares them, and tells you what is NOT the same. As in, what numbers from list1 are not in list2. Would it be an array, or something...? Your help is appreciated.
-
probably best would be a HashSet or other collection.
- 02-17-2009, 10:20 PM #3
Member
- Join Date
- Feb 2009
- Posts
- 3
- Rep Power
- 0
-
What exactly are the homework requirements here? Did the teacher give a list of what can and can't be used here? Is there a text of the assignment you can post here?
- 02-17-2009, 11:24 PM #5
I would just create two arrays.
Next create a loop which cycles through the arrays and checks if any of the elements are the same..
Hope this helps.They're 10 people in the world, those who speak binary, and those who dont.
^ Lame i know, but i can actually count in it nowadays! :eek:
- 02-18-2009, 01:22 AM #6
Member
- Join Date
- Feb 2009
- Posts
- 3
- Rep Power
- 0
Teacher? I administer server clusters. The mapping we use for connectivity uses a huge lists of numbers. When we install the system we do a range, and then we must go through and remove the non needed "node" numbers for efficiency sake. I would like to compare a user defined range, say 1000-8000, against a sorted list of actual node numbers that were copied from excel or somewhere else and pasted - then using some type of class (I think), give me the numbers not needed.
I know many programs can be used to do this. But I am trying to use Java to do it...cause I am trying to learn Java.
I do appreciate the help.
Similar Threads
-
rounding a double in a number of significant numbers
By rikribbers in forum Advanced JavaReplies: 2Last Post: 10-27-2008, 03:35 PM -
trying to add up random numbers into one number
By pjr5043 in forum New To JavaReplies: 4Last Post: 09-15-2008, 02:20 PM -
Compare 5 numbers
By Snowboardmylife in forum New To JavaReplies: 5Last Post: 04-15-2008, 07:04 PM -
Compare lists
By JavaNoob in forum New To JavaReplies: 2Last Post: 08-08-2007, 03:11 PM -
how to compare 2 vector lists?
By oregon in forum New To JavaReplies: 2Last Post: 07-25-2007, 08:25 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks