Consider the following algorithm:

String names [] = new String [20];
//assume array is initialized
System.out.println("Enter a name to search for: ");
String lookingFor = scan.nextLine();
int found = -1;
for (int i = 0; i < ; i++)
{
if ( lookingFor.equals (names[i]))
{
found = i;
break;
}
}
Which of the following best describes what this algorithm does?

Q&A Education