I am having trouble writing a binary search code to search through my string array. I have the user enter the name of a search engine (engine) they want to locate and my binary search function searches through my string array. Here is my code... [CODE] //****************************************************************************** //This function uses the binary search method to locate the search engine name in the array. The function //returns either a -1 (search engine not found) or the number of the element (location) where it was found //****************************************************************************** int binSearch (string name[], string engine) { int first = 0, last = MAX_NUM - …

Member Avatar
Member Avatar
+0 forum 4

I am making a page which pulls from the user's browser their preferred language, via the Request.UserLanguages....which returns a two letter code (ex. "en") or detailed code (ex. "en-GB"). I basically get the string of user languages (they are in order of preference) and store them in a string array. Then I use a loop to check if the language code in the first position of the string array is any of the codes for a certain language (another string array hard coded in). Is there a better way to do this? I'm noticing increased load time and am worried …

Member Avatar
Member Avatar
+0 forum 2

hey, i got a method that returns value which is java.util.List<java.lang.String>. this method actually contain data that was stored from .txt file which is simply names of people. how can i display this in the JList or how can i convert this value to a simple array so later i can work with it. this is a method that i need to work with [CODE] public StringArray displayNames() { StringArray name= new StringArray(); name.add("tom"); name.add("james"); name.add("lawrence"); return name; } [/CODE] i call this method and the value returned from it needs to be displayed in JList Thank You

Member Avatar
Member Avatar
+0 forum 4

The End.