Tongfamily Website

Tips, Tricks and Traps from the Tong’s

Tongfamily Website header image 4

Rewriting the Anagram program

April 12th, 2008 · No Comments · Geek

As Calvin pointed out, its a pain to do the string length and other calculations, so I went back and rewrote the anagram calculation using the prime number trick. That is, assign a prime to each letter from ‘a’ to ‘z’, then you can easily tell if two words are anagrams by multiplying all the [...]

[Read more →]

Tags: ···············