This Java program, Anagram.java, is designed to read a list of words from an input file, search for anagrams of each word in a CSV file, and write the results to an output file. Anagrams are words or phrases formed by rearranging the letters of another word or phrase. The program sorts each word alphabetically and matches it with its anagrams from the CSV file.
- Read words from an input file.
- Search for anagrams of each word in a CSV file.
- Write results to an output file.
- Java Development Kit (JDK) installed
- Input file containing a list of words
- CSV file containing sorted words and their anagrams
- Compile the Java code: javac Anagram.java
- Run the Java code: java Anagram <input_file>
This C++ program, Anagram Frequency Counter, reads a list of words from an input file, counts the frequency of characters in each word, sorts the characters alphabetically, and writes the sorted frequency along with the corresponding words to a CSV file. Anagrams are words or phrases formed by rearranging the letters of another word or phrase. The program then stores the sorted frequency as the key in a dictionary and maintains a list of words corresponding to each sorted frequency.
- Read words from an input file.
- Count the frequency of characters in each word.
- Sort the characters alphabetically.
- Write the sorted frequency along with the corresponding words to a CSV file.
The input file words.txt
should contain a list of words separated by spaces or newlines.
The output file output.csv
will be generated by the program and will contain the sorted frequency in the first column and the corresponding words in the second column.