Anagram Checker

Client

University of Utah

Project Type

Java

Project Year

2022

As part of a larger word puzzle game, we have been asked to construct a program that determines if two words are anagrams and finds the largest group of anagrams in a list of words.  Two words are anagrams if they contain the same letters in the same frequency.  For example, "alert" and "later" are anagrams.

Now that we know how to implement an insertion sort, we are eager to use sorting to solve these two problems:

  • To check if two words are anagrams, simply sort the characters in each word.  If the sorted versions are the same, the words are anagrams of each other.
  • To find the largest group of anagrams in a list of words, sort the list with a Comparator that compares the sorted character representations of the words.  After the sort, any group of words that are anagrams of each other will be adjacent in the list.
No images found.

Contact Me!

If you'd like to work with me, please fill in the boxes below. I aim to respond within 24 hours.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.