The Artima Developer Community
Sponsored Link

Java Answers Forum
Need a generic algorithm

2 replies on 1 page. Most recent reply: Aug 3, 2006 5:34 AM by joe smith

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Venkatesan

Posts: 9
Nickname: venkki
Registered: Jun, 2003

Need a generic algorithm Posted: Jul 28, 2006 7:58 AM
Reply to this message Reply
Advertisement
Hi.

I have a task ..It goes like this..

I have 2 arrays..each array have more than one String values..but array sizes are not same..
Say for example,
First array contains elements like "a", "b","c","d", "e".
Second array contains elements like "a", "b","c"
My task is to pick the missed ones from the array..In this case, I need to get the values as "d", "e"..

Just of example, I given you a 5 element size array..but I need to arrive a common algorithm to find the differences in "n" size array..

Pl provide me your valuable tips sothat I could proceed further to achive this.

Thanks and regards,
Venkki.


Dave Hinton

Posts: 42
Nickname: catbells
Registered: Oct, 2003

Re: Need a generic algorithm Posted: Jul 31, 2006 2:27 AM
Reply to this message Reply
Use a java.util.Map.

joe smith

Posts: 21
Nickname: jetbrains
Registered: Jan, 2006

Re: Need a generic algorithm Posted: Aug 3, 2006 5:34 AM
Reply to this message Reply
Just use java hashmap see here http://www.developerzone.biz/index.php?option=com_content&task=view&id=90&Itemid=36

You also can use java arraylist see here
http://www.developerzone.biz/index.php?option=com_content&task=view&id=151&Itemid=36

Flat View: This topic has 2 replies on 1 page
Topic: Scripts Previous Topic   Next Topic Topic: ongoing nightmare with internal frame

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use