This fourth chapter of the book focused on hash tables, dictionaries, and sets. All of these collections are interesting data structures that can be used in various scenarios. By presenting such collections with detailed descriptions and examples, you have seen that choosing a proper data structure is not a trivial task and requires analysis of performance-related topics, because some of them operate better in retrieving values and some promote the addition and removal of data.
At the beginning, you have learned how to use two variants of a hash table, namely non-generic (the
Hashtable class) and generic (
Dictionary). The huge advantage of these is the very fast lookup for a value based on the key, which is the close O(1) operation. To achieve this goal, the hash function is used. Moreover, the sorted dictionary has been introduced as an interesting solution to solve the problem of unsorted items in the collection and to keep keys sorted all the time.
Afterwards, the high-performance...