home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk1.iso
/
altsrc
/
articles
/
11060
< prev
next >
Wrap
Internet Message Format
|
1994-08-01
|
1KB
Path: wupost!ukma!usenet.ins.cwru.edu!howland.reston.ans.net!agate!tcsi.tcs.com!sriram
From: sriram@tcs.com (Sriram Srinivasan)
Newsgroups: alt.sources
Subject: Re: Want: Intelligent/fast anagram solver
Date: 1 Aug 1994 14:06:28 GMT
Organization: Teknekron Communications Systems, Berkeley, California
Lines: 18
Distribution: world
Message-ID: <31ivh4$gl7@tcsi.tcs.com>
References: <31gal9$8je@hpwin055.uksr.hp.com> <CttGwI.2xp@freenet.carleton.ca>
NNTP-Posting-Host: glock.tcs.com
: In a previous article, martin@wyvern.bri.hp.com (Martin Ward) says:
:
: >Hi all,
: >
: >Anyone have an algorithm or some code to solve anagrams quickly?
: >
: >What I need is something to find the longest allowed word (given a dictionary
: >on disk) given a set of nine characters.
The algorithm is simple ...
1. Given a set of nine characters, sort the characters in ascending order.
2. For each word in the dictionary (with the length you are looking
for), do the same .. "fable" becomes "abefl".
3. Compare. If they are identical you have your anagram.
Sriram
(sriram@tcs.com)