Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2nd assignment question for writing compare to method .. please help

Status
Not open for further replies.

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top