ssBook class has a method sortByLastName that uses thetat rettraeticalv s by las
ID: 3700980 • Letter: S
Question
ssBook class has a method sortByLastName that uses thetat rettraeticalv s by last name. sortByLastName calls the method m entry that has the minimum value (the w ame that uses the selection sort algorithm to sort the address entry whose name (last, first) comes alphabetically befo 9. ok of the method minimumPosition that returns the index other names in a portion of the Add (and should) use the Pe oecified regardless of what you wrote in question 8. are to write the method minimumPosition. You may find me compareTo works as rson method compareTo when writing your solution. Assu private int minimumPositionlint from) 0. How large does n need to be so that 0.5*n'n is bigger than 2.5'n-3?Explanation / Answer
Question 9:
private int minimumPosition(int from)
{
//Assuming that address book is a string array with name str.
//Assuming that str has n entries in it.
int i, pos = from;
String min = str[from];
for(i = from; i < n; i++)
{
if(min.compareTo(str[i]) > 0)
{
pos = i;
min = str[i];
}
}
return pos;
}
Question 10:
for all n > 0 and n <= 3, above condition would be satisfied.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.