Relying on Hashing
A major problem with most sort routines is that they sort all the data in a dataset.
When the dataset is small, you hardly notice the amount of data that the sort rou-
tine attempts to move. However, as the dataset gets larger, the data movement
becomes noticeable as you sit staring at the screen for hours on end. A way around
this problem is to sort just the key information. A key is the identifying data for a
particular data record. When you interact with an employee record, the employee
name or number usually serves as a key for accessing all the other information
you have about the employee. It’s senseless to sort all the employee information
when you really need only the keys sorted, which is what using hashing is all
about. When working with these data structures, you gain a major speed advan-
tage by sorting the smaller amount of data presented by the keys, rather than the
records as a whole.
148
PART 2
Do'stlaringiz bilan baham: |