S-06 - * the left of that bit, but that's not important.) *...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
* the left of that bit, but that's not important.) * * The inner loop of an anagram program is testing to see if a * word fits in the collection of untried letters. Traditional methods * keep an array of 26 integers, which are then compared in turn. This * means that there are 26 comparisons per word. * * This method reduces the number of comparisons to MAX_QUAD, typically 2. * Instead of looping through an array, we merely perform the indicated * subtraction and test if any of the sign bits is set. */ /* The nuts and bolts: * * The dictionary is loaded and preprocessed. The preprocessed dictionary * is a concatenation of copies of the structure: * * struct dictword { * char bStructureSize; -- size of this structure * char cLetters; -- number of letters in the word * char achWord[]; -- the word itself (0- terminated) * } * * Since this is a variable-sized structure, we keep its size in the structure * itself for rapid stepping through the table. * * When a phrase is typed in, it is first preprocessed as described in
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

S-06 - * the left of that bit, but that's not important.) *...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online