Final answer:
To solve the problem of computing and displaying the occurrence frequencies of distinct words in a file, you can use the Raptor software flowchart. The algorithm involves reading and sorting the words from the file, and then counting the frequencies of each distinct word.
Step-by-step explanation:
To solve the given problem of computing and displaying the occurrence frequencies of distinct words in a file, we can use the Raptor software flowchart. Here is the algorithm:
- Read and open the file 'scrabble.txt'.
- Create an empty array to store the distinct words.
- Create another empty array to store the occurrence frequencies of the distinct words.
- Sort the words stored in the 'scrabble.txt' file.
- Traverse the sorted array of words.
- If the current word is not present in the distinct words array, add it to the array and set its occurrence frequency to 1 in the occurrence frequencies array.
- If the current word is already present in the distinct words array, increment its occurrence frequency in the occurrence frequencies array.
- Display the distinct words and their occurrence frequencies in the desired format.