3Searching AlgorithmsHard6 marks
A computer game uses a text file named WordList.txt containing 10 000 words, all in lower case. Each word is unique and is stored on a separate line of the text file.
An efficient algorithm is needed to check that a word input by the user is stored in WordList.txt. If the word is found, the line number where the word is stored must be output. If the word is not found, the message "Not Found" must be output.
Complete the steps needed to describe the algorithm. Do not include pseudocode statements in your answer.
The first three steps have been completed for you:
- 1set line counter to 0
- 2input a word
- 3convert the word to lower case
Continue the numbered steps to complete the algorithm.
Steps 4 onwards
0 words