Algorithm for Linear Search in Array of Strings
1. Start
2. Input Number of Strings (n)
3. Initialize Array of Strings with size n
4. Input Strings into the array
5. Input Target String
6. Initialize Index to -1
7. For Each String in Array:
o Compare the string with the target string
o If Strings Match:
Set Index to the current position
Break the loop
8. Check Index:
o If Index is -1: Print "Not Found"
o Else: Print "Found at Index"
9. End
Flowchart for Linear Search in Array of Strings
Here’s a description of how you might draw the flowchart:
1. Start
2. Input Number of Strings (n)
3. Initialize Array of Strings with size n
4. Input Strings into the array
5. Input Target String
6. Initialize Index to -1
7. For Each String in Array (i = 0 to n-1):
o Compare String[i] with Target String
o If Match:
Set Index to i
Break Loop
8. Is Index == -1?
o Yes: Print "Not Found"
o No: Print "Found at Index"
9. End