Home > Eiffelgrams

Eiffelgrams

Eiffelgrams is a project mainly written in Eiffel, it's free.

An anagram dictionary implemented in Eiffel

Eiffelgrams

An assignment I did a while ago, implementing John Bentley's algorithm for anagram lookups. I found little-to-no examples of Eiffel code online when I was learning, so I thought I'd post it as an example.

Of course, wrestling with Eiffel's file IO classes was much more challenging than understanding the relatively trivial algorithm.

anagram.e reads words from you, and gives you their anagrams from /usr/share/dict/words

anagram_dictionary.e Wraps Eiffel's HASHED_DICTIONARY (the pain, the pain of it all)

string_sorter.e Sorts the characters of a string - this uses quicksort, as instructed, but words are typically short enough for the O(n^2 ) or O(n log n) distinction not to matter too much.

Previous:clorun