Guest_imported
New member
- Jan 1, 1970
- 0
here is my second assignment that i just don't understand how to do. Please help
String class's compareTo method
public int compareTo(String anotherString)
Compares two strings lexicographically. The comparison is based on the Unicode value of each character in the strings.
Parameters:
anotherString - the String to be compared.
Returns:
the value 0 if the argument string is equal to this string; a value less than 0 if this string is lexicographically less than the string argument; and a value greater than 0 if this string is lexicographically greater than the string argument.
Assignment #2 - DUE Thursday 11/29/01 At beginning of class
Part 1
Write an insertion sort, that sorts an array of Strings named data.
Part 2
Write a binary search, that searches an array of Strings named data.
String class's compareTo method
public int compareTo(String anotherString)
Compares two strings lexicographically. The comparison is based on the Unicode value of each character in the strings.
Parameters:
anotherString - the String to be compared.
Returns:
the value 0 if the argument string is equal to this string; a value less than 0 if this string is lexicographically less than the string argument; and a value greater than 0 if this string is lexicographically greater than the string argument.
Assignment #2 - DUE Thursday 11/29/01 At beginning of class
Part 1
Write an insertion sort, that sorts an array of Strings named data.
Part 2
Write a binary search, that searches an array of Strings named data.