+ 9
Compare strings in lexicographic order?(Java or algorithm)
Does anyone know how to compare a range of words and organize them in lexicographic order? but can't use String.compareTo or Collator.
6 Answers
+ 7
i correct, i hope that now is OK đ
+ 4
perfect! only changes the signal from > to < in the if inside of the for. The word Java comes first in lexicographic order.
+ 4
for some inputs it does not work, but your code helped me to think better about the problem.
leao ana...leao comes first in your code
+ 2
hey, I have modified the code, now it seems to be working correctly for all inputs. Take a look and tell me pls
https://code.sololearn.com/c52YeSNtNkaJ/?ref=app
+ 2
I think now it is only necessary to allow the user to enter several words, store the words in arrays and send the aarray to the method classifies the words.