Posted by Jared Anderson on August 05, 1999 at 14:15:07:
In Reply to: HW 17 comparisons posted by Milly Pan on August 05, 1999 at 13:35:17:
: I totally understood the move-to-front example given today in class, but I just had one question about the "count" heuristic.
: Are "comparisons" merely the number of integers that must be 'traversed' as we move down the array, as with the move-to-front example, or do we have to count the comparing of each found element's new "count" field with those of its predecessors?
: [did that make sense?]
: thx
Based on (working through) the example of the Count heuristic in the book (on page 305), it seems to sill only be the comparisons you're making as you're finding the new value, and NOT comparisons made regarding the "counter". That would have made the example's total MUCH higher than 44.
Later