CS157

CS157: Intro to C, Part II                

Fall 2017                

HW 3                

CS157 HW3: Anagrams                

anagram - a word, phrase, or name formed by rearranging the letters of another, such as cinema, formed from iceman.                 

Description                

For this assignment you will write a program anagram.c to find anagrams of words on the command line with words in a dictionary file using dynamic memory and qsort. Your program will accept the name of the file and words to find on the command line as shown in the example below. Your program should print out the word and the sorted letters of that word on one line, followed by each anagram found in the dictionary on separate line.                 

    % tail ~cs157/pub/words
    zymotic
    zymotically
    zymotize
    zymotoxic
    zymurgies
    zymurgy
    zythem
    zythum
    zyzzyva
    zyzzyvas
    % c11 -Wall anagram.c
    % ./a.out ~cs157/pub/words time cool react
    Matches for time (eimt):
    emit
    item
    mite
    time
    Matches for cool (cloo):
    cool
    loco
    Matches for react (acert):
    caret
    carte
    cater
    cerat
    crate
    creat
    creta
    ecart
    react
    recta
    trace
    %

We will test your program with various words in the dictionary.                 

Requirements                

How to submit your homework:                

Use                 

    ~cs157/bin/checkin HW3 anagram.c

or web checkin                 

How to receive negative points:                

Turn in someone else’s work.

Modified: 2017-11-12T20:04                 

User: Guest                 

Check: HTML CSS
Edit History Source
Apply to CSU | Contact CSU | Disclaimer | Equal Opportunity
Colorado State University, Fort Collins, CO 80523 USA
© 2015 Colorado State University
CS Building