Anonymous user
Anagrams: Difference between revisions
→{{header|C}}
(minor correction to Clojure version) |
|||
Line 108:
#include <time.h>
char *sortedWord(const char *word, char *wbuf)
{
char *p1, *p2, *endwrd;
Line 152:
int Str_Hash( const char *key, int ix_max )
{
const char *cp
short mash;
int hash = 33501551;
mash = cxmap[*cp % CXMAP_SIZE];
hash =
hash &= 0x3FFFFFFF;
}
return hash % ix_max;
Line 168 ⟶ 167:
typedef struct sDictWord *DictWord;
struct sDictWord {
const char *word;
DictWord next;
};
Line 174 ⟶ 173:
typedef struct sHashEntry *HashEntry;
struct sHashEntry {
const char *key;
HashEntry next;
DictWord words;
Line 221 ⟶ 220:
we->next = he->words;
he->words = we;
he->wordCount
if ( maxPC < he->wordCount) {
maxPC = he->wordCount;
Line 232 ⟶ 231:
}
numWords
}
printf("%d words in dictionary max ana=%d\n", numWords, maxPC);
Line 239 ⟶ 238:
int main(
{
HashEntry he;
|