Set representation. Hashing
In chapter 6 we considered several representations for sets whose elements are integers of arbitrary size. However, all those representations are rather inefficient: at least one of the operations (membership test, adding/deleting an element) runs in time proportional to the number of elements in the set. This is unacceptable in almost all practical applications.
It is possible to find a set representation where all three operations mentioned run in time C log n (in the worst case) for sets with n elements. One such representation is considered in the next chapter. In this chapter, we consider another set representation that may require n operations in the worst case but is very efficient in a “typical”case. The method is called hashing.
We consider two versions of this technique. Open addressing (section 13.1) is somehow simpler (and more efficient in terms of space), especially if we do not need deletion. Then we consider (section 13.2) hashing with lists; this version of hashing is more flexible and easier to analyze.
KeywordsHash Function English Word Arbitrary Size Correct Word Natural Place
Unable to display preview. Download preview PDF.