L43 execution unit operations movl 4edx0 addl t1eax0

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: on lower1 (Figure 5.7), which we know to have quadratic complexity. 2. A hash function is applied to the string to create a number between 0 and × ½, for a hash table with × buckets. Our initial function simply summed the ASCII codes for the characters modulo ×. 3. Each hash bucket is organized as a linked list. The program scans down this list looking for a matching entry. If one is found, the frequency for this word is incremented. Otherwise, a new list element is created. Our initial version performed this operation recursively, inserting new elements at the end of the list. 4. Once the table has been generated, we sort all of the elements according to the frequencies. Our initial version used insertion sort. Figure 5.37 shows the profile results for different versions of our word-frequency analysis program. For each version, we divide the time into five categories: Sort Sorting the words by frequency. List Scanning the linked list for a matching word, inserting a new element if necessary. Lower Converting the stri...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online