Java CompareTo Method
807603Feb 13 2006 — edited Nov 27 2007does anyone know how the string compareTo method actually works? I am trying to use a binary search to find a word in an arraylist with a specific prefix.
i know that the compareTo method returns a 1 0 or -1 based on what the result of the comparison is but im interested in teh actual way that the comparison takes place.
Since i will be comparing a prefix to a complete word, i would like to know if this would cause any problems due to the difference in string lengths.
Do you guys have any other idea on how i can use a very fast searching method to search a sorted arraylist of words to see if any word with a specific prefix exists?