Results 1 to 3 of 3
Thread: Problem with linear search
- 09-14-2010, 05:57 AM #1
Problem with linear search
I can't for the life of me grasp this search and it's really getting to me at this point. This is what I've got so far and maybe someone can point out where I've gone wrong.
I also need to return whether or not I found a hit or not, how many probes it took, and return it in the form:Java Code:public String linearSearch(Country[] myCountries, int first1, int last1, String searchKey) { for(int i = 0; i < myCountries.length; i++) { boolean success; success = linearSearch(myCountries, int first2, int last2, String input[i]); System.out.println("Success: " + success + " " + myCountries[j].getCountryCode()); }//end for }//end linearSearch
found: the search key , probes: x
I dont have a return in here yet because I don't understand what I'm doing wrong here.
- 09-14-2010, 06:10 AM #2
- 09-14-2010, 06:28 AM #3
Similar Threads
-
problem with linear search
By Metastar in forum New To JavaReplies: 14Last Post: 09-14-2010, 08:01 PM -
linear systems of equations
By tyang in forum New To JavaReplies: 2Last Post: 03-24-2010, 03:13 PM -
Please help me with this program (Linear Search two arrays)
By Meta in forum New To JavaReplies: 1Last Post: 03-11-2010, 12:49 AM -
Hash table with linear probing
By Java Tip in forum java.langReplies: 0Last Post: 04-12-2008, 08:43 PM -
Help me(Linear Multiobjective programming)
By vinaytvijayan in forum Advanced JavaReplies: 2Last Post: 01-22-2008, 07:24 AM


LinkBack URL
About LinkBacks

Bookmarks