Skip to content

Anagrams and Palindromes

June 4, 2013

Anagrams

An anagram is a word that can be formed by shuffling the same letters of another word. e.g. “obscurantist, substraction” or “Bella, label”. Below is some code that will read from standard input a list of new line separated words, and generate the anagrams in that list.

Palindromes

A palindrome is a word that reads the same backwards and forward. e.g. radar, redder, kayak.

 

Advertisements

From → Algorithms

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: