The deadline for this lab is Wednesday 18 April 2007, 11:45:59 hours. Strictly no submissions will be accepted after the deadline.
Here are some words and its corresponding proper anagrams:
Note that “CANOE” and “OCEAN” have the same proper anagram of “ACENO”.
===== Begin Sample Text File ===== tips oCeAn SPIT tips CANoe Gastronomy from the Alps to the Mediterranean In France you will find a wide variety of excellent regional food ===== End Sample Text File =====
The words consists of a mix of upper case and lower case letters. There are no punctuation characters or digits in the file. The file consists of only letters, spaces, and newlines.
You may assume that each word has at the most 30 letters, and that there are at the most 1000 proper anagrams.
===== Begin Sample Output ===== Anagram Dictionary: Word #1 and frequency: a, 1. Word #2 and frequency: aadeeeimnnrrt, 1. Word #3 and frequency: acefnr, 1. Word #4 and frequency: aceno, 2. Word #5 and frequency: aegilnor, 1. Word #6 and frequency: aeirtvy, 1. Word #7 and frequency: agmnoorsty, 1. Word #8 and frequency: alps, 1. Word #9 and frequency: ceeellntx, 1. Word #10 and frequency: deiw, 1. Word #11 and frequency: dfin, 1. Word #12 and frequency: dfoo, 1. Word #13 and frequency: eht, 2. Word #14 and frequency: fmor, 1. Word #15 and frequency: fo, 1. Word #16 and frequency: illw, 1. Word #17 and frequency: in, 1. Word #18 and frequency: ipst, 3. Word #19 and frequency: ot, 1. Word #20 and frequency: ouy, 1. ===== End Sample Output =====
Note that the words “TIPS”, “SPIT”, and “PITS” all have the same proper anagram of “IPST”. Thus, the proper anagram “IPST” occurs three times.
Print the word number as shown in the sample output.
You are reminded to follow the sample output exactly; else marks will be deducted.
We will test your programs with other (more complicated) text input files.
char x[100][21];
So there are 100 rows with each row containing a null-terminated string, and there are 21 columns; the one extra column is needed to store the null-terminator for any string with twenty non-null characters.
To access the first string in the array, use x[0]. To access the second string, use x[1], and so on.
The first character of the first string is at x[0][0], the second character of the first string is at x[0][1], and so on.
Remember to submit your program frequently using the submit adict.c command, and check your submission using the check command.
All the best!