Memoirs of a Technocrat

by Niroshan Rajadurai

  • Increase font size
  • Default font size
  • Decrease font size

Anagram Solver

E-mail Print PDF
User Rating: / 1
PoorBest 

Write a C++ Anagram Solver that generates all permutations for a given word (or phrase) and compares these permutations to a dictionary. Assume you have access to a file containing a list of dictionary words. Assume C++ design and readability are more important than execution speed.

Please write your own permutation algorithm – do not use stl next_permutation.

 

  1. Provide an implementation for a program that takes characters from argv[1] and outputs to stdout a list of anagrams.
  2. Would you have written the implementation differently if execution speed was most important?
  3. What other useful features could you add to this program?
  4. What was the most difficult part of completing this question?
  5. If you’d like to: provide an alternative implementation in your favourite language.
  6. Did you use a computer to do this?
  7. How long did it take to do this question?

 

Comments (0)
Last Updated on Monday, 24 January 2011 12:28